Struct tower_util::UnsyncBoxService

source ·
pub struct UnsyncBoxService<T, U, E> { /* private fields */ }
Expand description

A boxed Service trait object.

Implementations§

source§

impl<T, U, E> UnsyncBoxService<T, U, E>

source

pub fn new<S>(inner: S) -> Self
where S: Service<T, Response = U, Error = E> + 'static, S::Future: 'static,

Trait Implementations§

source§

impl<T, U, E> Debug for UnsyncBoxService<T, U, E>
where T: Debug, U: Debug, E: Debug,

source§

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

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

impl<T, U, E> Service<T> for UnsyncBoxService<T, U, E>

§

type Response = U

Responses given by the service.
§

type Error = E

Errors produced by the service.
§

type Future = Pin<Box<dyn Future<Output = Result<U, E>>>>

The future response value.
source§

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

Returns Ready when the service is able to process requests. Read more
source§

fn call(&mut self, request: T) -> Pin<Box<dyn Future<Output = Result<U, E>>>>

Process the request and return the response asynchronously. Read more

Auto Trait Implementations§

§

impl<T, U, E> Freeze for UnsyncBoxService<T, U, E>

§

impl<T, U, E> !RefUnwindSafe for UnsyncBoxService<T, U, E>

§

impl<T, U, E> !Send for UnsyncBoxService<T, U, E>

§

impl<T, U, E> !Sync for UnsyncBoxService<T, U, E>

§

impl<T, U, E> Unpin for UnsyncBoxService<T, U, E>

§

impl<T, U, E> !UnwindSafe for UnsyncBoxService<T, U, E>

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