EntityDecoder

object EntityDecoder extends EntityDecoderCompanionPlatform

EntityDecoder is used to attempt to decode an EntityBody This companion object provides a way to create new EntityDecoders along with some commonly used instances which can be resolved implicitly.

Companion
class
trait EntityDecoderCompanionPlatform
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply[F[_], T](implicit ev: EntityDecoder[F, T]): EntityDecoder[F, T]

summon an implicit EntityDecoder

summon an implicit EntityDecoder

def collectBinary[F[_]](m: Media[F])(implicit evidence$3: Concurrent[F]): DecodeResult[F, Chunk[Byte]]

Helper method which simply gathers the body into a single Chunk

Helper method which simply gathers the body into a single Chunk

def decodeBy[F[_], T](r1: MediaRange, rs: MediaRange*)(f: Media[F] => DecodeResult[F, T])(implicit evidence$2: Applicative[F]): EntityDecoder[F, T]

Create a new EntityDecoder

Create a new EntityDecoder

The new EntityDecoder will attempt to decode messages of type T only if the Message satisfies the provided MediaRange.

Exceptions thrown by f are not caught. Care should be taken that recoverable errors are returned as a DecodeResult#failure, or that system errors are raised in F.

def decodeText[F[_]](m: Media[F])(implicit F: Concurrent[F], defaultCharset: Charset): F[String]

Decodes a message to a String

Decodes a message to a String

def error[F[_], T](t: Throwable)(implicit F: Concurrent[F]): EntityDecoder[F, T]

Provides a mechanism to fail decoding

Provides a mechanism to fail decoding

Implicits

Implicits

implicit def binary[F[_]](implicit evidence$4: Concurrent[F]): EntityDecoder[F, Chunk[Byte]]
implicit def byteArrayDecoder[F[_]](implicit evidence$5: Concurrent[F]): EntityDecoder[F, Array[Byte]]
implicit def charArrayDecoder[F[_]](implicit evidence$6: Concurrent[F]): EntityDecoder[F, Array[Char]]
implicit def multipart[F[_]](implicit evidence$7: Concurrent[F]): EntityDecoder[F, Multipart[F]]
implicit def semigroupKForEntityDecoder[F[_]](implicit evidence$1: Functor[F]): SemigroupK[[_] =>> EntityDecoder[F, _$5]]
implicit def text[F[_]](implicit F: Concurrent[F], defaultCharset: Charset): EntityDecoder[F, String]
implicit def void[F[_]](implicit evidence$8: Concurrent[F]): EntityDecoder[F, Unit]

An entity decoder that ignores the content and returns unit.

An entity decoder that ignores the content and returns unit.