EntityEncoder

Companion:
class
Source:
EntityEncoder.scala
class Object
trait Matchable
class Any

Value members

Concrete methods

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

summon an implicit EntityEncoder

summon an implicit EntityEncoder

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

Create a new EntityEncoder

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

Create a new EntityEncoder

def showEncoder[F[_], A](implicit 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.

Source:
EntityEncoder.scala
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.

Source:
EntityEncoder.scala

Implicits

Implicits

implicit def charArrayEncoder[F[_]](implicit charset: Charset): EntityEncoder[F, Array[Char]]
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.

Source:
EntityEncoder.scala
implicit def inputStreamEncoder[F[_] : Sync, IS <: InputStream]: EntityEncoder[F, F[IS]]
implicit def pathEncoder[F[_] : Files]: EntityEncoder[F, Path]
implicit def readerEncoder[F[_], R <: Reader](implicit F: Sync[F], charset: Charset): EntityEncoder[F, F[R]]
implicit def streamEncoder[F[_], A](implicit 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.

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

Deprecated implicits

@deprecated("Use pathEncoder with fs2.io.file.Path", "0.23.5")
implicit def fileEncoder[F[_] : Files]: EntityEncoder[F, File]
Deprecated
Source:
EntityEncoder.scala
@deprecated("Use pathEncoder with fs2.io.file.Path", "0.23.5")
implicit def filePathEncoder[F[_] : Files]: EntityEncoder[F, Path]
Deprecated
Source:
EntityEncoder.scala