Struct apalis::prelude::Request

source ·
pub struct Request<T> { /* private fields */ }
Expand description

Represents a job which can be serialized and executed

Implementations§

source§

impl<T> Request<T>

source

pub fn new(req: T) -> Request<T>

Available on crate feature retry only.

Creates a new Request

source

pub fn new_with_data(req: T, data: Extensions) -> Request<T>

Available on crate feature retry only.

Creates a request with context provided

source

pub fn inner(&self) -> &T

Available on crate feature retry only.

Get the underlying reference of the request

source

pub fn take(self) -> T

Available on crate feature retry only.

Take the underlying reference of the request

Methods from Deref<Target = Extensions>§

source

pub fn insert<T>(&mut self, val: T) -> Option<T>
where T: Clone + Send + Sync + 'static,

Insert a type into this Extensions.

If a extension of this type already existed, it will be returned.

§Example
let mut ext = Extensions::new();
assert!(ext.insert(5i32).is_none());
assert!(ext.insert(4u8).is_none());
assert_eq!(ext.insert(9i32), Some(5i32));
source

pub fn get<T>(&self) -> Option<&T>
where T: Send + Sync + 'static,

Get a reference to a type previously inserted on this Extensions.

§Example
let mut ext = Extensions::new();
assert!(ext.get::<i32>().is_none());
ext.insert(5i32);

assert_eq!(ext.get::<i32>(), Some(&5i32));
source

pub fn get_mut<T>(&mut self) -> Option<&mut T>
where T: Send + Sync + 'static,

Get a mutable reference to a type previously inserted on this Extensions.

§Example
let mut ext = Extensions::new();
ext.insert(String::from("Hello"));
ext.get_mut::<String>().unwrap().push_str(" World");

assert_eq!(ext.get::<String>().unwrap(), "Hello World");
source

pub fn remove<T>(&mut self) -> Option<T>
where T: Send + Sync + 'static,

Remove a type from this Extensions.

If a extension of this type existed, it will be returned.

§Example
let mut ext = Extensions::new();
ext.insert(5i32);
assert_eq!(ext.remove::<i32>(), Some(5i32));
assert!(ext.get::<i32>().is_none());
source

pub fn clear(&mut self)

Clear the Extensions of all inserted extensions.

§Example
let mut ext = Extensions::new();
ext.insert(5i32);
ext.clear();

assert!(ext.get::<i32>().is_none());
source

pub fn is_empty(&self) -> bool

Check whether the extension set is empty or not.

§Example
let mut ext = Extensions::new();
assert!(ext.is_empty());
ext.insert(5i32);
assert!(!ext.is_empty());
source

pub fn len(&self) -> usize

Get the numer of extensions available.

§Example
let mut ext = Extensions::new();
assert_eq!(ext.len(), 0);
ext.insert(5i32);
assert_eq!(ext.len(), 1);
source

pub fn extend(&mut self, other: Extensions)

Extends self with another Extensions.

If an instance of a specific type exists in both, the one in self is overwritten with the one from other.

§Example
let mut ext_a = Extensions::new();
ext_a.insert(8u8);
ext_a.insert(16u16);

let mut ext_b = Extensions::new();
ext_b.insert(4u8);
ext_b.insert("hello");

ext_a.extend(ext_b);
assert_eq!(ext_a.len(), 3);
assert_eq!(ext_a.get::<u8>(), Some(&4u8));
assert_eq!(ext_a.get::<u16>(), Some(&16u16));
assert_eq!(ext_a.get::<&'static str>().copied(), Some("hello"));

Trait Implementations§

source§

impl<T> Backend<Request<T>> for MemoryStorage<T>
where T: Send + 'static + Sync,

§

type Stream = BackendStream<Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>>>

The stream to be produced by the backend
§

type Layer = ServiceBuilder<Identity>

Returns the final decoration of layers
source§

fn common_layer( &self, _worker: WorkerId ) -> <MemoryStorage<T> as Backend<Request<T>>>::Layer

Allows the backend to decorate the service with Layer
source§

fn poll( self, _worker: WorkerId ) -> Poller<<MemoryStorage<T> as Backend<Request<T>>>::Stream>

Returns a poller that is ready for streaming
source§

impl<T> Backend<Request<T>> for MysqlStorage<T>
where T: Job + Serialize + DeserializeOwned + Sync + Send + Unpin + 'static,

§

type Stream = BackendStream<Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>>>

The stream to be produced by the backend
§

type Layer = AckLayer<MysqlStorage<T>, T>

Returns the final decoration of layers
source§

fn common_layer( &self, worker_id: WorkerId ) -> <MysqlStorage<T> as Backend<Request<T>>>::Layer

Allows the backend to decorate the service with Layer
source§

fn poll( self, worker: WorkerId ) -> Poller<<MysqlStorage<T> as Backend<Request<T>>>::Stream>

Returns a poller that is ready for streaming
source§

impl<T> Backend<Request<T>> for Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>>

§

type Stream = Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>>

The stream to be produced by the backend
§

type Layer = ServiceBuilder<Identity>

Returns the final decoration of layers
source§

fn common_layer( &self, _worker: WorkerId ) -> <Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>> as Backend<Request<T>>>::Layer

Allows the backend to decorate the service with Layer
source§

fn poll( self, _worker: WorkerId ) -> Poller<<Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>> as Backend<Request<T>>>::Stream>

Returns a poller that is ready for streaming
source§

impl<T> Backend<Request<T>> for PostgresStorage<T>
where T: Job + Serialize + DeserializeOwned + Sync + Send + Unpin + 'static,

§

type Stream = BackendStream<Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>>>

The stream to be produced by the backend
§

type Layer = AckLayer<PostgresStorage<T>, T>

Returns the final decoration of layers
source§

fn common_layer( &self, worker_id: WorkerId ) -> <PostgresStorage<T> as Backend<Request<T>>>::Layer

Allows the backend to decorate the service with Layer
source§

fn poll( self, worker: WorkerId ) -> Poller<<PostgresStorage<T> as Backend<Request<T>>>::Stream>

Returns a poller that is ready for streaming
source§

impl<T> Backend<Request<T>> for RedisStorage<T>
where T: Job + Serialize + DeserializeOwned + Sync + Send + Unpin + 'static,

§

type Stream = BackendStream<Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>>>

The stream to be produced by the backend
§

type Layer = AckLayer<RedisStorage<T>, T>

Returns the final decoration of layers
source§

fn common_layer( &self, worker_id: WorkerId ) -> <RedisStorage<T> as Backend<Request<T>>>::Layer

Allows the backend to decorate the service with Layer
source§

fn poll( self, worker: WorkerId ) -> Poller<<RedisStorage<T> as Backend<Request<T>>>::Stream>

Returns a poller that is ready for streaming
source§

impl<T> Backend<Request<T>> for SqliteStorage<T>
where T: Job + Serialize + DeserializeOwned + Sync + Send + Unpin + 'static,

§

type Stream = BackendStream<Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>>>

The stream to be produced by the backend
§

type Layer = AckLayer<SqliteStorage<T>, T>

Returns the final decoration of layers
source§

fn common_layer( &self, worker_id: WorkerId ) -> <SqliteStorage<T> as Backend<Request<T>>>::Layer

Allows the backend to decorate the service with Layer
source§

fn poll( self, worker: WorkerId ) -> Poller<<SqliteStorage<T> as Backend<Request<T>>>::Stream>

Returns a poller that is ready for streaming
source§

impl<T> Clone for Request<T>
where T: Clone,

source§

fn clone(&self) -> Request<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> Debug for Request<T>
where T: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<T> Deref for Request<T>

§

type Target = Extensions

The resulting type after dereferencing.
source§

fn deref(&self) -> &<Request<T> as Deref>::Target

Dereferences the value.
source§

impl<T> DerefMut for Request<T>

source§

fn deref_mut(&mut self) -> &mut <Request<T> as Deref>::Target

Mutably dereferences the value.
source§

impl<'de, T> Deserialize<'de> for Request<T>
where T: Deserialize<'de>,

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<Request<T>, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T> From<RedisJob<T>> for Request<T>

source§

fn from(val: RedisJob<T>) -> Request<T>

Converts to this type from the input type.
source§

impl<T> From<SqlRequest<T>> for Request<T>

source§

fn from(val: SqlRequest<T>) -> Request<T>

Converts to this type from the input type.
source§

impl<T, Res> Policy<Request<T>, Res, Error> for RetryPolicy
where T: Clone,

Available on crate feature retry only.
§

type Future = Ready<RetryPolicy>

The Future type returned by Policy::retry.
source§

fn retry( &self, req: &Request<T>, result: Result<&Res, &Error> ) -> Option<Self::Future>

Check the policy if a certain request should be retried. Read more
source§

fn clone_request(&self, req: &Request<T>) -> Option<Request<T>>

Tries to clone a request before being passed to the inner service. Read more
source§

impl<T> Serialize for Request<T>
where T: Serialize,

source§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<S, J, F, Res> Service<Request<J>> for PrometheusService<S>
where S: Service<Request<J>, Response = Res, Error = Error, Future = F>, F: Future<Output = Result<Res, Error>> + 'static, J: Job,

Available on crate feature prometheus only.
§

type Response = <S as Service<Request<J>>>::Response

Responses given by the service.
§

type Error = <S as Service<Request<J>>>::Error

Errors produced by the service.
§

type Future = ResponseFuture<F>

The future response value.
source§

fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call(&mut self, request: Request<J>) -> Self::Future

Process the request and return the response asynchronously. Read more
source§

impl<S, J, F, Res> Service<Request<J>> for SentryJobService<S>
where S: Service<Request<J>, Response = Res, Error = Error, Future = F>, F: Future<Output = Result<Res, Error>> + 'static, J: Job,

Available on crate feature sentry only.
§

type Response = <S as Service<Request<J>>>::Response

Responses given by the service.
§

type Error = <S as Service<Request<J>>>::Error

Errors produced by the service.
§

type Future = SentryHttpFuture<<S as Service<Request<J>>>::Future>

The future response value.
source§

fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call(&mut self, request: Request<J>) -> Self::Future

Process the request and return the response asynchronously. Read more
source§

impl<J, S, OnRequestT, OnResponseT, OnFailureT, MakeSpanT, F, Res> Service<Request<J>> for Trace<S, MakeSpanT, OnRequestT, OnResponseT, OnFailureT>
where S: Service<Request<J>, Response = Res, Error = Error, Future = F> + Unpin + Send + 'static, S::Error: Display + 'static, MakeSpanT: MakeSpan<J>, OnRequestT: OnRequest<J>, OnResponseT: OnResponse<Res> + Clone + 'static, F: Future<Output = Result<Res, Error>> + 'static, OnFailureT: OnFailure + Clone + 'static,

Available on crate feature tracing only.
§

type Response = Res

Responses given by the service.
§

type Error = Error

Errors produced by the service.
§

type Future = ResponseFuture<F, OnResponseT, OnFailureT>

The future response value.
source§

fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call(&mut self, req: Request<J>) -> Self::Future

Process the request and return the response asynchronously. Read more
source§

impl<S, T, Req> Service<Request<Req>> for AddExtension<S, T>
where S: Service<Request<Req>>, T: Clone + Send + Sync + 'static,

§

type Response = <S as Service<Request<Req>>>::Response

Responses given by the service.
§

type Error = <S as Service<Request<Req>>>::Error

Errors produced by the service.
§

type Future = <S as Service<Request<Req>>>::Future

The future response value.
source§

fn poll_ready( &mut self, cx: &mut Context<'_> ) -> Poll<Result<(), <AddExtension<S, T> as Service<Request<Req>>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call( &mut self, req: Request<Req> ) -> <AddExtension<S, T> as Service<Request<Req>>>::Future

Process the request and return the response asynchronously. Read more
source§

impl<T, F, Req, E, R> Service<Request<Req>> for ServiceFn<T, ()>
where T: FnMut(Req) -> F, F: Future, <F as Future>::Output: IntoResponse<Result = Result<R, E>>,

§

type Response = R

Responses given by the service.
§

type Error = E

Errors produced by the service.
§

type Future = Map<F, fn(_: <F as Future>::Output) -> Result<R, E>>

The future response value.
source§

fn poll_ready( &mut self, _: &mut Context<'_> ) -> Poll<Result<(), <ServiceFn<T, ()> as Service<Request<Req>>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call( &mut self, task: Request<Req> ) -> <ServiceFn<T, ()> as Service<Request<Req>>>::Future

Process the request and return the response asynchronously. Read more
source§

impl<T, F, Req, E, R, A1, A2> Service<Request<Req>> for ServiceFn<T, (A1, A2)>
where T: FnMut(Req, A1, A2) -> F, F: Future, <F as Future>::Output: IntoResponse<Result = Result<R, E>>, A1: FromData, A2: FromData,

§

type Response = R

Responses given by the service.
§

type Error = E

Errors produced by the service.
§

type Future = Map<F, fn(_: <F as Future>::Output) -> Result<R, E>>

The future response value.
source§

fn poll_ready( &mut self, _: &mut Context<'_> ) -> Poll<Result<(), <ServiceFn<T, (A1, A2)> as Service<Request<Req>>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call( &mut self, task: Request<Req> ) -> <ServiceFn<T, (A1, A2)> as Service<Request<Req>>>::Future

Process the request and return the response asynchronously. Read more
source§

impl<T, F, Req, E, R, A1, A2, A3> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3)>
where T: FnMut(Req, A1, A2, A3) -> F, F: Future, <F as Future>::Output: IntoResponse<Result = Result<R, E>>, A1: FromData, A2: FromData, A3: FromData,

§

type Response = R

Responses given by the service.
§

type Error = E

Errors produced by the service.
§

type Future = Map<F, fn(_: <F as Future>::Output) -> Result<R, E>>

The future response value.
source§

fn poll_ready( &mut self, _: &mut Context<'_> ) -> Poll<Result<(), <ServiceFn<T, (A1, A2, A3)> as Service<Request<Req>>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call( &mut self, task: Request<Req> ) -> <ServiceFn<T, (A1, A2, A3)> as Service<Request<Req>>>::Future

Process the request and return the response asynchronously. Read more
source§

impl<T, F, Req, E, R, A1, A2, A3, A4> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4)>
where T: FnMut(Req, A1, A2, A3, A4) -> F, F: Future, <F as Future>::Output: IntoResponse<Result = Result<R, E>>, A1: FromData, A2: FromData, A3: FromData, A4: FromData,

§

type Response = R

Responses given by the service.
§

type Error = E

Errors produced by the service.
§

type Future = Map<F, fn(_: <F as Future>::Output) -> Result<R, E>>

The future response value.
source§

fn poll_ready( &mut self, _: &mut Context<'_> ) -> Poll<Result<(), <ServiceFn<T, (A1, A2, A3, A4)> as Service<Request<Req>>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call( &mut self, task: Request<Req> ) -> <ServiceFn<T, (A1, A2, A3, A4)> as Service<Request<Req>>>::Future

Process the request and return the response asynchronously. Read more
source§

impl<T, F, Req, E, R, A1, A2, A3, A4, A5> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5)>
where T: FnMut(Req, A1, A2, A3, A4, A5) -> F, F: Future, <F as Future>::Output: IntoResponse<Result = Result<R, E>>, A1: FromData, A2: FromData, A3: FromData, A4: FromData, A5: FromData,

§

type Response = R

Responses given by the service.
§

type Error = E

Errors produced by the service.
§

type Future = Map<F, fn(_: <F as Future>::Output) -> Result<R, E>>

The future response value.
source§

fn poll_ready( &mut self, _: &mut Context<'_> ) -> Poll<Result<(), <ServiceFn<T, (A1, A2, A3, A4, A5)> as Service<Request<Req>>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call( &mut self, task: Request<Req> ) -> <ServiceFn<T, (A1, A2, A3, A4, A5)> as Service<Request<Req>>>::Future

Process the request and return the response asynchronously. Read more
source§

impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6)>
where T: FnMut(Req, A1, A2, A3, A4, A5, A6) -> F, F: Future, <F as Future>::Output: IntoResponse<Result = Result<R, E>>, A1: FromData, A2: FromData, A3: FromData, A4: FromData, A5: FromData, A6: FromData,

§

type Response = R

Responses given by the service.
§

type Error = E

Errors produced by the service.
§

type Future = Map<F, fn(_: <F as Future>::Output) -> Result<R, E>>

The future response value.
source§

fn poll_ready( &mut self, _: &mut Context<'_> ) -> Poll<Result<(), <ServiceFn<T, (A1, A2, A3, A4, A5, A6)> as Service<Request<Req>>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call( &mut self, task: Request<Req> ) -> <ServiceFn<T, (A1, A2, A3, A4, A5, A6)> as Service<Request<Req>>>::Future

Process the request and return the response asynchronously. Read more
source§

impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7)>
where T: FnMut(Req, A1, A2, A3, A4, A5, A6, A7) -> F, F: Future, <F as Future>::Output: IntoResponse<Result = Result<R, E>>, A1: FromData, A2: FromData, A3: FromData, A4: FromData, A5: FromData, A6: FromData, A7: FromData,

§

type Response = R

Responses given by the service.
§

type Error = E

Errors produced by the service.
§

type Future = Map<F, fn(_: <F as Future>::Output) -> Result<R, E>>

The future response value.
source§

fn poll_ready( &mut self, _: &mut Context<'_> ) -> Poll<Result<(), <ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7)> as Service<Request<Req>>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call( &mut self, task: Request<Req> ) -> <ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7)> as Service<Request<Req>>>::Future

Process the request and return the response asynchronously. Read more
source§

impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8)>
where T: FnMut(Req, A1, A2, A3, A4, A5, A6, A7, A8) -> F, F: Future, <F as Future>::Output: IntoResponse<Result = Result<R, E>>, A1: FromData, A2: FromData, A3: FromData, A4: FromData, A5: FromData, A6: FromData, A7: FromData, A8: FromData,

§

type Response = R

Responses given by the service.
§

type Error = E

Errors produced by the service.
§

type Future = Map<F, fn(_: <F as Future>::Output) -> Result<R, E>>

The future response value.
source§

fn poll_ready( &mut self, _: &mut Context<'_> ) -> Poll<Result<(), <ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8)> as Service<Request<Req>>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call( &mut self, task: Request<Req> ) -> <ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8)> as Service<Request<Req>>>::Future

Process the request and return the response asynchronously. Read more
source§

impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9)>
where T: FnMut(Req, A1, A2, A3, A4, A5, A6, A7, A8, A9) -> F, F: Future, <F as Future>::Output: IntoResponse<Result = Result<R, E>>, A1: FromData, A2: FromData, A3: FromData, A4: FromData, A5: FromData, A6: FromData, A7: FromData, A8: FromData, A9: FromData,

§

type Response = R

Responses given by the service.
§

type Error = E

Errors produced by the service.
§

type Future = Map<F, fn(_: <F as Future>::Output) -> Result<R, E>>

The future response value.
source§

fn poll_ready( &mut self, _: &mut Context<'_> ) -> Poll<Result<(), <ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9)> as Service<Request<Req>>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call( &mut self, task: Request<Req> ) -> <ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9)> as Service<Request<Req>>>::Future

Process the request and return the response asynchronously. Read more
source§

impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>
where T: FnMut(Req, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) -> F, F: Future, <F as Future>::Output: IntoResponse<Result = Result<R, E>>, A1: FromData, A2: FromData, A3: FromData, A4: FromData, A5: FromData, A6: FromData, A7: FromData, A8: FromData, A9: FromData, A10: FromData,

§

type Response = R

Responses given by the service.
§

type Error = E

Errors produced by the service.
§

type Future = Map<F, fn(_: <F as Future>::Output) -> Result<R, E>>

The future response value.
source§

fn poll_ready( &mut self, _: &mut Context<'_> ) -> Poll<Result<(), <ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> as Service<Request<Req>>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call( &mut self, task: Request<Req> ) -> <ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> as Service<Request<Req>>>::Future

Process the request and return the response asynchronously. Read more
source§

impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)>
where T: FnMut(Req, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) -> F, F: Future, <F as Future>::Output: IntoResponse<Result = Result<R, E>>, A1: FromData, A2: FromData, A3: FromData, A4: FromData, A5: FromData, A6: FromData, A7: FromData, A8: FromData, A9: FromData, A10: FromData, A11: FromData,

§

type Response = R

Responses given by the service.
§

type Error = E

Errors produced by the service.
§

type Future = Map<F, fn(_: <F as Future>::Output) -> Result<R, E>>

The future response value.
source§

fn poll_ready( &mut self, _: &mut Context<'_> ) -> Poll<Result<(), <ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)> as Service<Request<Req>>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call( &mut self, task: Request<Req> ) -> <ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)> as Service<Request<Req>>>::Future

Process the request and return the response asynchronously. Read more
source§

impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)>
where T: FnMut(Req, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) -> F, F: Future, <F as Future>::Output: IntoResponse<Result = Result<R, E>>, A1: FromData, A2: FromData, A3: FromData, A4: FromData, A5: FromData, A6: FromData, A7: FromData, A8: FromData, A9: FromData, A10: FromData, A11: FromData, A12: FromData,

§

type Response = R

Responses given by the service.
§

type Error = E

Errors produced by the service.
§

type Future = Map<F, fn(_: <F as Future>::Output) -> Result<R, E>>

The future response value.
source§

fn poll_ready( &mut self, _: &mut Context<'_> ) -> Poll<Result<(), <ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)> as Service<Request<Req>>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call( &mut self, task: Request<Req> ) -> <ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)> as Service<Request<Req>>>::Future

Process the request and return the response asynchronously. Read more
source§

impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)>
where T: FnMut(Req, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) -> F, F: Future, <F as Future>::Output: IntoResponse<Result = Result<R, E>>, A1: FromData, A2: FromData, A3: FromData, A4: FromData, A5: FromData, A6: FromData, A7: FromData, A8: FromData, A9: FromData, A10: FromData, A11: FromData, A12: FromData, A13: FromData,

§

type Response = R

Responses given by the service.
§

type Error = E

Errors produced by the service.
§

type Future = Map<F, fn(_: <F as Future>::Output) -> Result<R, E>>

The future response value.
source§

fn poll_ready( &mut self, _: &mut Context<'_> ) -> Poll<Result<(), <ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)> as Service<Request<Req>>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call( &mut self, task: Request<Req> ) -> <ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)> as Service<Request<Req>>>::Future

Process the request and return the response asynchronously. Read more
source§

impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)>
where T: FnMut(Req, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) -> F, F: Future, <F as Future>::Output: IntoResponse<Result = Result<R, E>>, A1: FromData, A2: FromData, A3: FromData, A4: FromData, A5: FromData, A6: FromData, A7: FromData, A8: FromData, A9: FromData, A10: FromData, A11: FromData, A12: FromData, A13: FromData, A14: FromData,

§

type Response = R

Responses given by the service.
§

type Error = E

Errors produced by the service.
§

type Future = Map<F, fn(_: <F as Future>::Output) -> Result<R, E>>

The future response value.
source§

fn poll_ready( &mut self, _: &mut Context<'_> ) -> Poll<Result<(), <ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)> as Service<Request<Req>>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call( &mut self, task: Request<Req> ) -> <ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)> as Service<Request<Req>>>::Future

Process the request and return the response asynchronously. Read more
source§

impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15)>
where T: FnMut(Req, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) -> F, F: Future, <F as Future>::Output: IntoResponse<Result = Result<R, E>>, A1: FromData, A2: FromData, A3: FromData, A4: FromData, A5: FromData, A6: FromData, A7: FromData, A8: FromData, A9: FromData, A10: FromData, A11: FromData, A12: FromData, A13: FromData, A14: FromData, A15: FromData,

§

type Response = R

Responses given by the service.
§

type Error = E

Errors produced by the service.
§

type Future = Map<F, fn(_: <F as Future>::Output) -> Result<R, E>>

The future response value.
source§

fn poll_ready( &mut self, _: &mut Context<'_> ) -> Poll<Result<(), <ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15)> as Service<Request<Req>>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call( &mut self, task: Request<Req> ) -> <ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15)> as Service<Request<Req>>>::Future

Process the request and return the response asynchronously. Read more
source§

impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16)>
where T: FnMut(Req, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) -> F, F: Future, <F as Future>::Output: IntoResponse<Result = Result<R, E>>, A1: FromData, A2: FromData, A3: FromData, A4: FromData, A5: FromData, A6: FromData, A7: FromData, A8: FromData, A9: FromData, A10: FromData, A11: FromData, A12: FromData, A13: FromData, A14: FromData, A15: FromData, A16: FromData,

§

type Response = R

Responses given by the service.
§

type Error = E

Errors produced by the service.
§

type Future = Map<F, fn(_: <F as Future>::Output) -> Result<R, E>>

The future response value.
source§

fn poll_ready( &mut self, _: &mut Context<'_> ) -> Poll<Result<(), <ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16)> as Service<Request<Req>>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call( &mut self, task: Request<Req> ) -> <ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16)> as Service<Request<Req>>>::Future

Process the request and return the response asynchronously. Read more
source§

impl<T, F, Req, E, R, A> Service<Request<Req>> for ServiceFn<T, A>
where T: FnMut(Req, A) -> F, F: Future, <F as Future>::Output: IntoResponse<Result = Result<R, E>>, A: FromData,

§

type Response = R

Responses given by the service.
§

type Error = E

Errors produced by the service.
§

type Future = Map<F, fn(_: <F as Future>::Output) -> Result<R, E>>

The future response value.
source§

fn poll_ready( &mut self, _: &mut Context<'_> ) -> Poll<Result<(), <ServiceFn<T, A> as Service<Request<Req>>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call( &mut self, task: Request<Req> ) -> <ServiceFn<T, A> as Service<Request<Req>>>::Future

Process the request and return the response asynchronously. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Request<T>
where T: Freeze,

§

impl<T> !RefUnwindSafe for Request<T>

§

impl<T> Send for Request<T>
where T: Send,

§

impl<T> Sync for Request<T>
where T: Sync,

§

impl<T> Unpin for Request<T>
where T: Unpin,

§

impl<T> !UnwindSafe for Request<T>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,