public interface LowerPriorityGenericUnmarshallers
Modifier and Type | Method and Description |
---|---|
<L,R> Unmarshaller<HttpEntity,scala.util.Either<L,R>> |
eitherUnmarshaller(Unmarshaller<HttpEntity,L> ua,
scala.reflect.ClassTag<R> rightTag,
Unmarshaller<HttpEntity,R> ub,
scala.reflect.ClassTag<L> leftTag)
Enables using
Either to encode the following unmarshalling logic:
Attempt unmarshalling the entity as as R first (yielding R ),
and if it fails attempt unmarshalling as L (yielding Left ). |
<A,B> Unmarshaller<scala.Option<A>,B> |
liftToSourceOptionUnmarshaller(Unmarshaller<A,B> um) |
<T> Unmarshaller<HttpMessage,T> |
messageUnmarshallerFromEntityUnmarshaller(Unmarshaller<HttpEntity,T> um) |
<A,B> Unmarshaller<scala.Option<A>,B> |
sourceOptionUnmarshaller(Unmarshaller<A,B> um) |
<T> Unmarshaller<HttpMessage,T> messageUnmarshallerFromEntityUnmarshaller(Unmarshaller<HttpEntity,T> um)
<A,B> Unmarshaller<scala.Option<A>,B> liftToSourceOptionUnmarshaller(Unmarshaller<A,B> um)
<A,B> Unmarshaller<scala.Option<A>,B> sourceOptionUnmarshaller(Unmarshaller<A,B> um)
<L,R> Unmarshaller<HttpEntity,scala.util.Either<L,R>> eitherUnmarshaller(Unmarshaller<HttpEntity,L> ua, scala.reflect.ClassTag<R> rightTag, Unmarshaller<HttpEntity,R> ub, scala.reflect.ClassTag<L> leftTag)
Either
to encode the following unmarshalling logic:
Attempt unmarshalling the entity as as R
first (yielding R
),
and if it fails attempt unmarshalling as L
(yielding Left
).
The either unmarshaller only works with strict entities, so make sure to wrap routes that want to use it with
toStrictEntity
. Otherwise, if a non-strict entity is provided, it will fail with an IllegalArgumentException
.
Note that the Either's "R" type will be attempted first (as Left is often considered as the "failed case" in Either).
ua
- (undocumented)rightTag
- (undocumented)ub
- (undocumented)leftTag
- (undocumented)