object EntityDecoder
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
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply[F[_], T](implicit ev: EntityDecoder[F, T]): EntityDecoder[F, T]
summon an implicit EntityDecoder
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def binFile[F[_]](file: File, blockingExecutionContext: ExecutionContext)(implicit F: Sync[F], cs: ContextShift[F]): EntityDecoder[F, File]
- implicit def binary[F[_]](implicit arg0: Sync[F]): EntityDecoder[F, Chunk[Byte]]
- implicit def byteArrayDecoder[F[_]](implicit arg0: Sync[F]): EntityDecoder[F, Array[Byte]]
- implicit def charArrayDecoder[F[_]](implicit arg0: Sync[F]): EntityDecoder[F, Array[Char]]
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
collectBinary[F[_]](msg: Message[F])(implicit arg0: Sync[F]): DecodeResult[F, Chunk[Byte]]
Helper method which simply gathers the body into a single Chunk
-
def
decodeBy[F[_], T](r1: MediaRange, rs: MediaRange*)(f: (Message[F]) ⇒ DecodeResult[F, T])(implicit arg0: 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 inF
. -
def
decodeString[F[_]](msg: Message[F])(implicit arg0: Sync[F], defaultCharset: Charset = DefaultCharset): F[String]
Decodes a message to a String
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
error[F[_], T](t: Throwable)(implicit F: Sync[F]): EntityDecoder[F, T]
Provides a mechanism to fail decoding
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- implicit def multipart[F[_]](implicit arg0: Sync[F]): EntityDecoder[F, Multipart[F]]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- implicit def semigroupKForEntityDecoder[F[_]](implicit arg0: Functor[F]): SemigroupK[[β$0$]EntityDecoder[F, β$0$]]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- implicit def text[F[_]](implicit arg0: Sync[F], defaultCharset: Charset = DefaultCharset): EntityDecoder[F, String]
- def textFile[F[_]](file: File, blockingExecutionContext: ExecutionContext)(implicit F: Sync[F], cs: ContextShift[F]): EntityDecoder[F, File]
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
implicit
def
void[F[_]](implicit arg0: Sync[F]): EntityDecoder[F, Unit]
An entity decoder that ignores the content and returns unit.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
Deprecated Value Members
-
def
binaryChunk[F[_]](implicit arg0: Sync[F]): EntityDecoder[F, Chunk[Byte]]
- Annotations
- @deprecated
- Deprecated
(Since version 0.19.0-M2) Use
binary
instead