EntityEncoder

Companion
class
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply[F[_], A](ev: EntityEncoder[F, A]): EntityEncoder[F, A]

summon an implicit EntityEncoder

summon an implicit EntityEncoder

def emptyEncoder[F[_], A]: EntityEncoder[F, A]
def encodeBy[F[_], A](hs: Headers)(f: A => Entity[F]): EntityEncoder[F, A]

Create a new EntityEncoder

Create a new EntityEncoder

def encodeBy[F[_], A](hs: ToRaw*)(f: A => Entity[F]): EntityEncoder[F, A]

Create a new EntityEncoder

Create a new EntityEncoder

def fileEncoder[F[_]](blocker: Blocker)(`evidence$1`: Sync[F], `evidence$2`: ContextShift[F]): EntityEncoder[F, File]
def filePathEncoder[F[_]](blocker: Blocker)(`evidence$3`: Sync[F], `evidence$4`: ContextShift[F]): EntityEncoder[F, Path]
def inputStreamEncoder[F[_], IS <: InputStream](blocker: Blocker)(`evidence$5`: Sync[F], `evidence$6`: ContextShift[F]): EntityEncoder[F, F[IS]]
def showEncoder[F[_], A](charset: Charset, show: Show[A]): EntityEncoder[F, A]

Encodes a value from its Show instance. Too broad to be implicit, too useful to not exist.

Encodes a value from its Show instance. Too broad to be implicit, too useful to not exist.

def simple[F[_], A](hs: ToRaw*)(toChunk: A => Chunk[Byte]): EntityEncoder[F, A]

Create a new EntityEncoder

Create a new EntityEncoder

This constructor is a helper for types that can be serialized synchronously, for example a String.

Implicits

Implicits

implicit def byteArrayEncoder[F[_]]: EntityEncoder[F, Array[Byte]]
implicit def charArrayEncoder[F[_]](charset: Charset): EntityEncoder[F, Array[Char]]
implicit def chunkEncoder[F[_]]: EntityEncoder[F, Chunk[Byte]]
implicit def entityBodyEncoder[F[_]]: EntityEncoder[F, EntityBody[F]]

Encodes an entity body. Chunking of the stream is preserved. A Transfer-Encoding: chunked header is set, as we cannot know the content length without running the stream.

Encodes an entity body. Chunking of the stream is preserved. A Transfer-Encoding: chunked header is set, as we cannot know the content length without running the stream.

implicit def entityEncoderContravariant[F[_]]: Contravariant[[_] =>> EntityEncoder[F, _$25]]
implicit def multipartEncoder[F[_]]: EntityEncoder[F, Multipart[F]]
implicit def readerEncoder[F[_], R <: Reader](blocker: Blocker)(F: Sync[F], cs: ContextShift[F], charset: Charset): EntityEncoder[F, F[R]]
implicit def streamEncoder[F[_], A](W: EntityEncoder[F, A]): EntityEncoder[F, Stream[F, A]]

A stream encoder is intended for streaming, and does not calculate its bodies in advance. As such, it does not calculate the Content-Length in advance. This is for use with chunked transfer encoding.

A stream encoder is intended for streaming, and does not calculate its bodies in advance. As such, it does not calculate the Content-Length in advance. This is for use with chunked transfer encoding.

implicit def stringEncoder[F[_]](charset: Charset): EntityEncoder[F, String]
implicit def unitEncoder[F[_]]: EntityEncoder[F, Unit]