Marshaller

org.apache.pekko.http.scaladsl.marshalling.Marshaller
See theMarshaller companion class

Attributes

Companion
class
Source
Marshaller.scala
Graph
Supertypes
Self type
Marshaller.type

Members list

Value members

Concrete methods

def apply[A, B](f: ExecutionContext => A => Future[List[Marshalling[B]]]): Marshaller[A, B]

Creates a Marshaller from the given function.

Creates a Marshaller from the given function.

Attributes

Source
Marshaller.scala
def combined[A, B, C](marshal: A => B)(implicit m2: Marshaller[B, C]): Marshaller[A, C]

Helper for creating a Marshaller combined of the provided marshal function and an implicit Marshaller which is able to produce the required final type.

Helper for creating a Marshaller combined of the provided marshal function and an implicit Marshaller which is able to produce the required final type.

Attributes

Source
Marshaller.scala
def oneOf[A, B](marshallers: Marshaller[A, B]*): Marshaller[A, B]

Helper for creating a "super-marshaller" from a number of "sub-marshallers". Content-negotiation determines, which "sub-marshaller" eventually gets to do the job.

Helper for creating a "super-marshaller" from a number of "sub-marshallers". Content-negotiation determines, which "sub-marshaller" eventually gets to do the job.

Please note that all marshallers will actually be invoked in order to get the Marshalling object out of them, and later decide which of the marshallings should be returned. This is by-design, however in ticket as discussed in ticket https://github.com/akka/akka-http/issues/243 it MAY be changed in later versions of Pekko HTTP.

Attributes

Source
Marshaller.scala
def oneOf[T, A, B](values: T*)(f: T => Marshaller[A, B]): Marshaller[A, B]

Helper for creating a "super-marshaller" from a number of values and a function producing "sub-marshallers" from these values. Content-negotiation determines, which "sub-marshaller" eventually gets to do the job.

Helper for creating a "super-marshaller" from a number of values and a function producing "sub-marshallers" from these values. Content-negotiation determines, which "sub-marshaller" eventually gets to do the job.

Please note that all marshallers will actually be invoked in order to get the Marshalling object out of them, and later decide which of the marshallings should be returned. This is by-design, however in ticket as discussed in ticket https://github.com/akka/akka-http/issues/243 it MAY be changed in later versions of Pekko HTTP.

Attributes

Source
Marshaller.scala
def opaque[A, B](marshal: A => B): Marshaller[A, B]

Helper for creating a synchronous Marshaller to non-negotiable content from the given function.

Helper for creating a synchronous Marshaller to non-negotiable content from the given function.

Attributes

Source
Marshaller.scala
def strict[A, B](f: A => Marshalling[B]): Marshaller[A, B]

Helper for creating a Marshaller using the given function.

Helper for creating a Marshaller using the given function.

Attributes

Source
Marshaller.scala
def withFixedContentType[A, B](contentType: ContentType)(marshal: A => B): Marshaller[A, B]

Helper for creating a synchronous Marshaller to content with a fixed charset from the given function.

Helper for creating a synchronous Marshaller to content with a fixed charset from the given function.

Attributes

Source
Marshaller.scala
def withOpenCharset[A, B](mediaType: WithOpenCharset)(marshal: (A, HttpCharset) => B): Marshaller[A, B]

Helper for creating a synchronous Marshaller to content with a negotiable charset from the given function.

Helper for creating a synchronous Marshaller to content with a negotiable charset from the given function.

Attributes

Source
Marshaller.scala

Implicits

Inherited implicits

implicit def eitherMarshaller[A1, A2, B](implicit m1: Marshaller[A1, B], m2: Marshaller[A2, B]): Marshaller[Either[A1, A2], B]

Attributes

Inherited from:
GenericMarshallers
Source
GenericMarshallers.scala

Creates a response for a status code. Does not support content-type negotiation but will return a response either with a text-plain entity containing the status.defaultMessage or an empty entity for status codes that don't allow a response.

Creates a response for a status code. Does not support content-type negotiation but will return a response either with a text-plain entity containing the status.defaultMessage or an empty entity for status codes that don't allow a response.

Attributes

Inherited from:
PredefinedToResponseMarshallers
Source
PredefinedToResponseMarshallers.scala

Creates a response from status code and headers. Does not support content-type negotiation but will return a response either with a text-plain entity containing the status.defaultMessage or an empty entity for status codes that don't allow a response.

Creates a response from status code and headers. Does not support content-type negotiation but will return a response either with a text-plain entity containing the status.defaultMessage or an empty entity for status codes that don't allow a response.

Attributes

Inherited from:
PredefinedToResponseMarshallers
Source
PredefinedToResponseMarshallers.scala
implicit def fromStatusCodeAndValue[S, T](implicit sConv: S => StatusCode, mt: ToEntityMarshaller[T]): ToResponseMarshaller[(S, T)]
implicit def futureMarshaller[A, B](implicit m: Marshaller[A, B]): Marshaller[Future[A], B]

Attributes

Inherited from:
GenericMarshallers
Source
GenericMarshallers.scala
implicit def multipartMarshaller[T <: Multipart](implicit log: LoggingAdapter): ToEntityMarshaller[T]

Attributes

Inherited from:
MultipartMarshallers
Source
MultipartMarshallers.scala
implicit def optionMarshaller[A, B](implicit m: Marshaller[A, B], empty: EmptyValue[B]): Marshaller[Option[A], B]

Attributes

Inherited from:
GenericMarshallers
Source
GenericMarshallers.scala

Attributes

Inherited from:
GenericMarshallers
Source
GenericMarshallers.scala
implicit def tryMarshaller[A, B](implicit m: Marshaller[A, B]): Marshaller[Try[A], B]

Attributes

Inherited from:
GenericMarshallers
Source
GenericMarshallers.scala