Decoder

tyrian.http.Decoder$package.Decoder
object Decoder

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Decoder.type

Members list

Value members

Concrete methods

def apply[Msg](onResponse: Response => Msg, onError: HttpError => Msg): () => Msg

Construct a decoder from two functions that handle a Response or an HttpError. Alias for Decoder.fold

Construct a decoder from two functions that handle a Response or an HttpError. Alias for Decoder.fold

Attributes

def asString[Msg](toMsg: String => Msg): () => Msg

Unintelligently returns the body or the error message as a string in a message.

Unintelligently returns the body or the error message as a string in a message.

Attributes

def fold[Msg](onResponse: Response => Msg, onError: HttpError => Msg): () => Msg

Construct a decoder from two functions that handle a Response or an HttpError.

Construct a decoder from two functions that handle a Response or an HttpError.

Attributes

Extensions

Extensions

extension [Msg](d: () => Msg)
def apply(result: Response | HttpError): Msg

Convert a Response or an HttpError into a Msg.

Convert a Response or an HttpError into a Msg.

Attributes

def withError(result: HttpError): Msg

Convert an HttpError into a Msg.

Convert an HttpError into a Msg.

Attributes

def withResponse(result: Response): Msg

Convert a Response into a Msg.

Convert a Response into a Msg.

Attributes