object EntityDecoder extends EntityDecoderInstances
EntityDecoder is used to attempt to decode an EntityBody
This companion object provides a way to create new EntityDecoder
s along
with some commonly used instances which can be resolved implicitly.
- Source
- EntityDecoder.scala
- Alphabetic
- By Inheritance
- EntityDecoder
- EntityDecoderInstances
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
def
apply[T](implicit ev: EntityDecoder[T]): EntityDecoder[T]
summon an implicit EntityEncoder
-
def
binFile(file: File): EntityDecoder[File]
- Definition Classes
- EntityDecoderInstances
-
implicit
val
binary: EntityDecoder[ByteVector]
- Definition Classes
- EntityDecoderInstances
-
def
collectBinary(msg: Message): DecodeResult[ByteVector]
Helper method which simply gathers the body into a single ByteVector
-
def
decodeBy[T](r1: MediaRange, rs: MediaRange*)(f: (Message) ⇒ DecodeResult[T]): EntityDecoder[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 MediaRanges -
def
decodeString(msg: Message)(implicit defaultCharset: Charset = DefaultCharset): Task[String]
Decodes a message to a String
-
def
error[T](t: Throwable): EntityDecoder[T]
Provides a mechanism to fail decoding
Provides a mechanism to fail decoding
- Definition Classes
- EntityDecoderInstances
-
implicit
def
multipart: EntityDecoder[Multipart]
- Definition Classes
- EntityDecoderInstances
-
implicit
def
text(implicit defaultCharset: Charset = DefaultCharset): EntityDecoder[String]
- Definition Classes
- EntityDecoderInstances
-
def
textFile(file: File): EntityDecoder[File]
- Definition Classes
- EntityDecoderInstances