Struct salvo::Service[][src]

pub struct Service { /* fields omitted */ }

Implementations

impl Service[src]

pub fn new<T>(router: T) -> Service where
    T: Into<Arc<Router>>, 
[src]

pub fn router(&self) -> Arc<Router>[src]

pub fn with_catchers<T>(self, catchers: T) -> Service where
    T: Into<Arc<Vec<Box<dyn Catcher + 'static, Global>, Global>>>, 
[src]

when the response code is 400-600 and the body is empty, capture and set the return value. By default, it is the built-in default html page.

pub fn catchers(&self) -> Arc<Vec<Box<dyn Catcher + 'static, Global>, Global>>[src]

pub fn with_allowed_media_types<T>(self, allowed_media_types: T) -> Service where
    T: Into<Arc<Vec<Mime, Global>>>, 
[src]

pub fn allowed_media_types(&self) -> Arc<Vec<Mime, Global>>[src]

Trait Implementations

impl<'t, T> Service<&'t T> for Service where
    T: Transport, 
[src]

type Response = HyperHandler

Responses given by the service.

type Error = Error

Errors produced by the service.

type Future = Ready<Result<<Service as Service<&'t T>>::Response, <Service as Service<&'t T>>::Error>>

The future response value.

pub fn poll_ready(
    &mut self,
    _cx: &mut Context<'_>
) -> Poll<Result<(), <Service as Service<&'t T>>::Error>>
[src]

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

pub fn call(&mut self, target: &T) -> <Service as Service<&'t T>>::Future[src]

Process the request and return the response asynchronously. Read more

Auto Trait Implementations

impl !RefUnwindSafe for Service

impl Send for Service

impl Sync for Service

impl Unpin for Service

impl !UnwindSafe for Service

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

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

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

fn in_current_span(self) -> Instrumented<Self>[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

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

pub fn vzip(self) -> V