pub struct BoxedService<Request, Response, E> { /* private fields */ }

Implementations§

source§

impl<Request, Response, E> BoxedService<Request, Response, E>

source

pub fn new<S>(s: S) -> Selfwhere S: Service<Request, Response = Response, Error = E> + 'static, Request: 'static,

source

pub fn downcast_ref<T: Any>(&self) -> Option<&T>

source

pub unsafe fn downcast_ref_unchecked<T: Any>(&self) -> &T

Safety

If you are sure the inner type is T, you can downcast it.

Trait Implementations§

source§

impl<Request, Response, E> Drop for BoxedService<Request, Response, E>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<Request, Response, E> Service<Request> for BoxedService<Request, Response, E>

§

type Response = Response

Responses given by the service.
§

type Error = E

Errors produced by the service.
§

type Future<'cx> = Pin<Box<dyn Future<Output = Result<Response, E>> + 'cx, Global>> where Self: 'cx, Request: 'cx

The future response value.
source§

fn call(&self, req: Request) -> Self::Future<'_>

Process the request and return the response asynchronously.

Auto Trait Implementations§

§

impl<Request, Response, E> RefUnwindSafe for BoxedService<Request, Response, E>

§

impl<Request, Response, E> !Send for BoxedService<Request, Response, E>

§

impl<Request, Response, E> !Sync for BoxedService<Request, Response, E>

§

impl<Request, Response, E> Unpin for BoxedService<Request, Response, E>

§

impl<Request, Response, E> UnwindSafe for BoxedService<Request, Response, E>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T, Request, Response, E> BoxService<Request, Response, E> for Twhere T: Service<Request, Response = Response, Error = E> + 'static, Request: 'static,

source§

fn into_boxed(self) -> BoxedService<Request, Response, E>

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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 Twhere 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 Twhere 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.