Struct NewWebService

Source
pub struct NewWebService<T, U, M>
where T: Resource,
{ /* private fields */ }
Expand description

Creates new WebService values.

Instances of this type are created by ServiceBuilder. A NewWebService instance is used to generate a WebService instance per connection.

Trait Implementations§

Source§

impl<T, U, M> Debug for NewWebService<T, U, M>
where T: Resource + Debug, T::Destination: Debug, U: Debug, M: Debug,

Source§

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

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

impl<T, U, M> NewService for NewWebService<T, U, M>
where T: Resource, U: Catch, M: HttpMiddleware<RoutedService<T, U>>,

Source§

type Request = Request<<M as HttpMiddleware<RoutedService<T, U>>>::RequestBody>

Requests handled by the service
Source§

type Response = Response<<M as HttpMiddleware<RoutedService<T, U>>>::ResponseBody>

Responses given by the service
Source§

type Error = <M as HttpMiddleware<RoutedService<T, U>>>::Error

Errors produced by the service
Source§

type Service = WebService<T, U, M>

The Service value created by this factory
Source§

type InitError = Never

Errors produced while building a service.
Source§

type Future = FutureResult<<NewWebService<T, U, M> as NewService>::Service, <NewWebService<T, U, M> as NewService>::InitError>

The future of the Service instance.
Source§

fn new_service(&self) -> Self::Future

Create and return a new service value asynchronously.

Auto Trait Implementations§

§

impl<T, U, M> Freeze for NewWebService<T, U, M>
where M: Freeze, T: Freeze, U: Freeze,

§

impl<T, U, M> !RefUnwindSafe for NewWebService<T, U, M>

§

impl<T, U, M> Send for NewWebService<T, U, M>
where M: Send, T: Send, U: Send,

§

impl<T, U, M> Sync for NewWebService<T, U, M>
where M: Sync, T: Sync, U: Sync,

§

impl<T, U, M> Unpin for NewWebService<T, U, M>
where M: Unpin, T: Unpin, U: Unpin,

§

impl<T, U, M> !UnwindSafe for NewWebService<T, U, M>

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> 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, B1, B2> NewHttpService for T
where T: NewService<Request = Request<B1>, Response = Response<B2>>, B1: BufStream, B2: BufStream,

Source§

type RequestBody = B1

The HTTP request body handled by the service.
Source§

type ResponseBody = B2

The HTTP response body returned by the service.
Source§

type Error = <T as NewService>::Error

Errors produced by the service
Source§

type Service = <T as NewService>::Service

The Service value created by this factory
Source§

type InitError = <T as NewService>::InitError

Errors produced while building a service.
Source§

type Future = <T as NewService>::Future

The future of the Service instance.
Source§

fn new_http_service(&self) -> <T as NewHttpService>::Future

Create and return a new service value asynchronously.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.