Struct ServiceFn

Source
pub struct ServiceFn<T, Req, Ctx, FnArgs> { /* private fields */ }
Expand description

An executable service implemented by a closure.

See service_fn for more details.

Trait Implementations§

Source§

impl<T: Clone, Req: Clone, Ctx: Clone, FnArgs: Clone> Clone for ServiceFn<T, Req, Ctx, FnArgs>

Source§

fn clone(&self) -> ServiceFn<T, Req, Ctx, FnArgs>

Returns a duplicate 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, Req, Ctx, FnArgs> Debug for ServiceFn<T, Req, Ctx, FnArgs>

Source§

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

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

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

Source§

type Response = R

Responses given by the service.
Source§

type Error = E

Errors produced by the service.
Source§

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<(), Self::Error>>

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

fn call(&mut self, task: Request<Req, Ctx>) -> Self::Future

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

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

Source§

type Response = R

Responses given by the service.
Source§

type Error = E

Errors produced by the service.
Source§

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

The future response value.
Source§

fn poll_ready(&mut self, _: &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, task: Request<Req, Ctx>) -> Self::Future

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

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

Source§

type Response = R

Responses given by the service.
Source§

type Error = E

Errors produced by the service.
Source§

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

The future response value.
Source§

fn poll_ready(&mut self, _: &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, task: Request<Req, Ctx>) -> Self::Future

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

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

Source§

type Response = R

Responses given by the service.
Source§

type Error = E

Errors produced by the service.
Source§

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

The future response value.
Source§

fn poll_ready(&mut self, _: &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, task: Request<Req, Ctx>) -> Self::Future

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

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

Source§

type Response = R

Responses given by the service.
Source§

type Error = E

Errors produced by the service.
Source§

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

The future response value.
Source§

fn poll_ready(&mut self, _: &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, task: Request<Req, Ctx>) -> Self::Future

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

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

Source§

type Response = R

Responses given by the service.
Source§

type Error = E

Errors produced by the service.
Source§

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

The future response value.
Source§

fn poll_ready(&mut self, _: &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, task: Request<Req, Ctx>) -> Self::Future

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

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

Source§

type Response = R

Responses given by the service.
Source§

type Error = E

Errors produced by the service.
Source§

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

The future response value.
Source§

fn poll_ready(&mut self, _: &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, task: Request<Req, Ctx>) -> Self::Future

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

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

Source§

type Response = R

Responses given by the service.
Source§

type Error = E

Errors produced by the service.
Source§

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

The future response value.
Source§

fn poll_ready(&mut self, _: &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, task: Request<Req, Ctx>) -> Self::Future

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

impl<T, F, Req, E, R, Ctx, A1, A2, A3, A4, A5, A6, A7, A8, A9> Service<Request<Req, Ctx>> for ServiceFn<T, Req, Ctx, (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::Output: IntoResponse<Result = Result<R, E>>, A1: FromRequest<Request<Req, Ctx>>, A2: FromRequest<Request<Req, Ctx>>, A3: FromRequest<Request<Req, Ctx>>, A4: FromRequest<Request<Req, Ctx>>, A5: FromRequest<Request<Req, Ctx>>, A6: FromRequest<Request<Req, Ctx>>, A7: FromRequest<Request<Req, Ctx>>, A8: FromRequest<Request<Req, Ctx>>, A9: FromRequest<Request<Req, Ctx>>, E: From<Error>,

Source§

type Response = R

Responses given by the service.
Source§

type Error = E

Errors produced by the service.
Source§

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

The future response value.
Source§

fn poll_ready(&mut self, _: &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, task: Request<Req, Ctx>) -> Self::Future

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

impl<T, F, Req, E, R, Ctx, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> Service<Request<Req, Ctx>> for ServiceFn<T, Req, Ctx, (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::Output: IntoResponse<Result = Result<R, E>>, A1: FromRequest<Request<Req, Ctx>>, A2: FromRequest<Request<Req, Ctx>>, A3: FromRequest<Request<Req, Ctx>>, A4: FromRequest<Request<Req, Ctx>>, A5: FromRequest<Request<Req, Ctx>>, A6: FromRequest<Request<Req, Ctx>>, A7: FromRequest<Request<Req, Ctx>>, A8: FromRequest<Request<Req, Ctx>>, A9: FromRequest<Request<Req, Ctx>>, A10: FromRequest<Request<Req, Ctx>>, E: From<Error>,

Source§

type Response = R

Responses given by the service.
Source§

type Error = E

Errors produced by the service.
Source§

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

The future response value.
Source§

fn poll_ready(&mut self, _: &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, task: Request<Req, Ctx>) -> Self::Future

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

impl<T, F, Req, E, R, Ctx, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11> Service<Request<Req, Ctx>> for ServiceFn<T, Req, Ctx, (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::Output: IntoResponse<Result = Result<R, E>>, A1: FromRequest<Request<Req, Ctx>>, A2: FromRequest<Request<Req, Ctx>>, A3: FromRequest<Request<Req, Ctx>>, A4: FromRequest<Request<Req, Ctx>>, A5: FromRequest<Request<Req, Ctx>>, A6: FromRequest<Request<Req, Ctx>>, A7: FromRequest<Request<Req, Ctx>>, A8: FromRequest<Request<Req, Ctx>>, A9: FromRequest<Request<Req, Ctx>>, A10: FromRequest<Request<Req, Ctx>>, A11: FromRequest<Request<Req, Ctx>>, E: From<Error>,

Source§

type Response = R

Responses given by the service.
Source§

type Error = E

Errors produced by the service.
Source§

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

The future response value.
Source§

fn poll_ready(&mut self, _: &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, task: Request<Req, Ctx>) -> Self::Future

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

impl<T, F, Req, E, R, Ctx, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12> Service<Request<Req, Ctx>> for ServiceFn<T, Req, Ctx, (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::Output: IntoResponse<Result = Result<R, E>>, A1: FromRequest<Request<Req, Ctx>>, A2: FromRequest<Request<Req, Ctx>>, A3: FromRequest<Request<Req, Ctx>>, A4: FromRequest<Request<Req, Ctx>>, A5: FromRequest<Request<Req, Ctx>>, A6: FromRequest<Request<Req, Ctx>>, A7: FromRequest<Request<Req, Ctx>>, A8: FromRequest<Request<Req, Ctx>>, A9: FromRequest<Request<Req, Ctx>>, A10: FromRequest<Request<Req, Ctx>>, A11: FromRequest<Request<Req, Ctx>>, A12: FromRequest<Request<Req, Ctx>>, E: From<Error>,

Source§

type Response = R

Responses given by the service.
Source§

type Error = E

Errors produced by the service.
Source§

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

The future response value.
Source§

fn poll_ready(&mut self, _: &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, task: Request<Req, Ctx>) -> Self::Future

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

impl<T, F, Req, E, R, Ctx, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13> Service<Request<Req, Ctx>> for ServiceFn<T, Req, Ctx, (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::Output: IntoResponse<Result = Result<R, E>>, A1: FromRequest<Request<Req, Ctx>>, A2: FromRequest<Request<Req, Ctx>>, A3: FromRequest<Request<Req, Ctx>>, A4: FromRequest<Request<Req, Ctx>>, A5: FromRequest<Request<Req, Ctx>>, A6: FromRequest<Request<Req, Ctx>>, A7: FromRequest<Request<Req, Ctx>>, A8: FromRequest<Request<Req, Ctx>>, A9: FromRequest<Request<Req, Ctx>>, A10: FromRequest<Request<Req, Ctx>>, A11: FromRequest<Request<Req, Ctx>>, A12: FromRequest<Request<Req, Ctx>>, A13: FromRequest<Request<Req, Ctx>>, E: From<Error>,

Source§

type Response = R

Responses given by the service.
Source§

type Error = E

Errors produced by the service.
Source§

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

The future response value.
Source§

fn poll_ready(&mut self, _: &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, task: Request<Req, Ctx>) -> Self::Future

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

impl<T, F, Req, E, R, Ctx, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14> Service<Request<Req, Ctx>> for ServiceFn<T, Req, Ctx, (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::Output: IntoResponse<Result = Result<R, E>>, A1: FromRequest<Request<Req, Ctx>>, A2: FromRequest<Request<Req, Ctx>>, A3: FromRequest<Request<Req, Ctx>>, A4: FromRequest<Request<Req, Ctx>>, A5: FromRequest<Request<Req, Ctx>>, A6: FromRequest<Request<Req, Ctx>>, A7: FromRequest<Request<Req, Ctx>>, A8: FromRequest<Request<Req, Ctx>>, A9: FromRequest<Request<Req, Ctx>>, A10: FromRequest<Request<Req, Ctx>>, A11: FromRequest<Request<Req, Ctx>>, A12: FromRequest<Request<Req, Ctx>>, A13: FromRequest<Request<Req, Ctx>>, A14: FromRequest<Request<Req, Ctx>>, E: From<Error>,

Source§

type Response = R

Responses given by the service.
Source§

type Error = E

Errors produced by the service.
Source§

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

The future response value.
Source§

fn poll_ready(&mut self, _: &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, task: Request<Req, Ctx>) -> Self::Future

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

impl<T, F, Req, E, R, Ctx, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15> Service<Request<Req, Ctx>> for ServiceFn<T, Req, Ctx, (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::Output: IntoResponse<Result = Result<R, E>>, A1: FromRequest<Request<Req, Ctx>>, A2: FromRequest<Request<Req, Ctx>>, A3: FromRequest<Request<Req, Ctx>>, A4: FromRequest<Request<Req, Ctx>>, A5: FromRequest<Request<Req, Ctx>>, A6: FromRequest<Request<Req, Ctx>>, A7: FromRequest<Request<Req, Ctx>>, A8: FromRequest<Request<Req, Ctx>>, A9: FromRequest<Request<Req, Ctx>>, A10: FromRequest<Request<Req, Ctx>>, A11: FromRequest<Request<Req, Ctx>>, A12: FromRequest<Request<Req, Ctx>>, A13: FromRequest<Request<Req, Ctx>>, A14: FromRequest<Request<Req, Ctx>>, A15: FromRequest<Request<Req, Ctx>>, E: From<Error>,

Source§

type Response = R

Responses given by the service.
Source§

type Error = E

Errors produced by the service.
Source§

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

The future response value.
Source§

fn poll_ready(&mut self, _: &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, task: Request<Req, Ctx>) -> Self::Future

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

impl<T, F, Req, E, R, Ctx, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16> Service<Request<Req, Ctx>> for ServiceFn<T, Req, Ctx, (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::Output: IntoResponse<Result = Result<R, E>>, A1: FromRequest<Request<Req, Ctx>>, A2: FromRequest<Request<Req, Ctx>>, A3: FromRequest<Request<Req, Ctx>>, A4: FromRequest<Request<Req, Ctx>>, A5: FromRequest<Request<Req, Ctx>>, A6: FromRequest<Request<Req, Ctx>>, A7: FromRequest<Request<Req, Ctx>>, A8: FromRequest<Request<Req, Ctx>>, A9: FromRequest<Request<Req, Ctx>>, A10: FromRequest<Request<Req, Ctx>>, A11: FromRequest<Request<Req, Ctx>>, A12: FromRequest<Request<Req, Ctx>>, A13: FromRequest<Request<Req, Ctx>>, A14: FromRequest<Request<Req, Ctx>>, A15: FromRequest<Request<Req, Ctx>>, A16: FromRequest<Request<Req, Ctx>>, E: From<Error>,

Source§

type Response = R

Responses given by the service.
Source§

type Error = E

Errors produced by the service.
Source§

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

The future response value.
Source§

fn poll_ready(&mut self, _: &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, task: Request<Req, Ctx>) -> Self::Future

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

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

Source§

type Response = R

Responses given by the service.
Source§

type Error = E

Errors produced by the service.
Source§

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

The future response value.
Source§

fn poll_ready(&mut self, _: &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, task: Request<Req, Ctx>) -> Self::Future

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

impl<T: Copy, Req: Copy, Ctx: Copy, FnArgs: Copy> Copy for ServiceFn<T, Req, Ctx, FnArgs>

Auto Trait Implementations§

§

impl<T, Req, Ctx, FnArgs> Freeze for ServiceFn<T, Req, Ctx, FnArgs>
where T: Freeze,

§

impl<T, Req, Ctx, FnArgs> !RefUnwindSafe for ServiceFn<T, Req, Ctx, FnArgs>

§

impl<T, Req, Ctx, FnArgs> Send for ServiceFn<T, Req, Ctx, FnArgs>
where T: Send, FnArgs: Send, Req: Send, Ctx: Send,

§

impl<T, Req, Ctx, FnArgs> Sync for ServiceFn<T, Req, Ctx, FnArgs>
where T: Sync, FnArgs: Sync, Req: Sync, Ctx: Sync,

§

impl<T, Req, Ctx, FnArgs> Unpin for ServiceFn<T, Req, Ctx, FnArgs>
where T: Unpin, FnArgs: Unpin, Req: Unpin, Ctx: Unpin,

§

impl<T, Req, Ctx, FnArgs> !UnwindSafe for ServiceFn<T, Req, Ctx, FnArgs>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, Request> ServiceExt<Request> for T
where T: Service<Request> + ?Sized,

Source§

fn ready(&mut self) -> Ready<'_, Self, Request>
where Self: Sized,

Yields a mutable reference to the service when it is ready to accept a request.
Source§

fn ready_oneshot(self) -> ReadyOneshot<Self, Request>
where Self: Sized,

Yields the service when it is ready to accept a request.
Source§

fn oneshot(self, req: Request) -> Oneshot<Self, Request>
where Self: Sized,

Consume this Service, calling it with the provided request once it is ready.
Source§

fn call_all<S>(self, reqs: S) -> CallAll<Self, S>
where Self: Sized, S: Stream<Item = Request>,

Process all requests from the given Stream, and produce a Stream of their responses. Read more
Source§

fn and_then<F>(self, f: F) -> AndThen<Self, F>
where Self: Sized, F: Clone,

Executes a new future after this service’s future resolves. This does not alter the behaviour of the poll_ready method. Read more
Source§

fn map_response<F, Response>(self, f: F) -> MapResponse<Self, F>
where Self: Sized, F: FnOnce(Self::Response) -> Response + Clone,

Maps this service’s response value to a different value. This does not alter the behaviour of the poll_ready method. Read more
Source§

fn map_err<F, Error>(self, f: F) -> MapErr<Self, F>
where Self: Sized, F: FnOnce(Self::Error) -> Error + Clone,

Maps this service’s error value to a different value. This does not alter the behaviour of the poll_ready method. Read more
Source§

fn map_result<F, Response, Error>(self, f: F) -> MapResult<Self, F>
where Self: Sized, Error: From<Self::Error>, F: FnOnce(Result<Self::Response, Self::Error>) -> Result<Response, Error> + Clone,

Maps this service’s result type (Result<Self::Response, Self::Error>) to a different value, regardless of whether the future succeeds or fails. Read more
Source§

fn map_request<F, NewRequest>(self, f: F) -> MapRequest<Self, F>
where Self: Sized, F: FnMut(NewRequest) -> Request,

Composes a function in front of the service. Read more
Source§

fn then<F, Response, Error, Fut>(self, f: F) -> Then<Self, F>
where Self: Sized, Error: From<Self::Error>, F: FnOnce(Result<Self::Response, Self::Error>) -> Fut + Clone, Fut: Future<Output = Result<Response, Error>>,

Composes an asynchronous function after this service. Read more
Source§

fn map_future<F, Fut, Response, Error>(self, f: F) -> MapFuture<Self, F>
where Self: Sized, F: FnMut(Self::Future) -> Fut, Error: From<Self::Error>, Fut: Future<Output = Result<Response, Error>>,

Composes a function that transforms futures produced by the service. Read more
Source§

fn boxed(self) -> BoxService<Request, Self::Response, Self::Error>
where Self: Sized + Send + 'static, Self::Future: Send + 'static,

Convert the service into a Service + Send trait object. Read more
Source§

fn boxed_clone(self) -> BoxCloneService<Request, Self::Response, Self::Error>
where Self: Sized + Clone + Send + 'static, Self::Future: Send + 'static,

Convert the service into a Service + Clone + Send trait object. Read more
Source§

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

Source§

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>,

Source§

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>,

Source§

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