Interface MarshallingDirectives
-
- All Known Subinterfaces:
Directives,FramedEntityStreamingDirectives
- All Known Implementing Classes:
Directives$,HttpApp,MarshallingDirectives$
public interface MarshallingDirectives
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> Unmarshaller<HttpRequest,T>as(Unmarshaller<HttpRequest,T> um)Returns the in-scopeFromRequestUnmarshallerfor the given type.<T> scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>>completeWith(Marshaller<T,HttpResponse> marshaller, scala.Function1<scala.Function1<T,scala.runtime.BoxedUnit>,scala.runtime.BoxedUnit> inner)Uses the marshaller for the given type to produce a completion function that is passed to its inner function.<T> Directive<scala.Tuple1<T>>entity(Unmarshaller<HttpRequest,T> um)Unmarshalls the requests entity to the given type passes it to its inner Route.<A,B>
scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>>handleWith(scala.Function1<A,B> f, Unmarshaller<HttpRequest,A> um, Marshaller<B,HttpResponse> m)Completes the request using the given function.<T> Marshaller<T,HttpResponse>instanceOf(Marshaller<T,HttpResponse> m)Returns the in-scope Marshaller for the given type.
-
-
-
Method Detail
-
entity
<T> Directive<scala.Tuple1<T>> entity(Unmarshaller<HttpRequest,T> um)
Unmarshalls the requests entity to the given type passes it to its inner Route. If there is a problem with unmarshalling the request is rejected with theRejectionproduced by the unmarshaller.- Parameters:
um- (undocumented)- Returns:
- (undocumented)
-
as
<T> Unmarshaller<HttpRequest,T> as(Unmarshaller<HttpRequest,T> um)
Returns the in-scopeFromRequestUnmarshallerfor the given type.- Parameters:
um- (undocumented)- Returns:
- (undocumented)
-
completeWith
<T> scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> completeWith(Marshaller<T,HttpResponse> marshaller, scala.Function1<scala.Function1<T,scala.runtime.BoxedUnit>,scala.runtime.BoxedUnit> inner)
Uses the marshaller for the given type to produce a completion function that is passed to its inner function. You can use it do decouple marshaller resolution from request completion.- Parameters:
marshaller- (undocumented)inner- (undocumented)- Returns:
- (undocumented)
-
instanceOf
<T> Marshaller<T,HttpResponse> instanceOf(Marshaller<T,HttpResponse> m)
Returns the in-scope Marshaller for the given type.- Parameters:
m- (undocumented)- Returns:
- (undocumented)
-
handleWith
<A,B> scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> handleWith(scala.Function1<A,B> f, Unmarshaller<HttpRequest,A> um, Marshaller<B,HttpResponse> m)
Completes the request using the given function. The input to the function is produced with the in-scope entity unmarshaller and the result value of the function is marshalled with the in-scope marshaller.- Parameters:
f- (undocumented)um- (undocumented)m- (undocumented)- Returns:
- (undocumented)
-
-