Struct salvo_core::Service
source · [−]pub struct Service { /* private fields */ }
Expand description
Service http request.
Implementations
sourceimpl Service
impl Service
sourcepub fn new<T>(router: T) -> Service where
T: Into<Arc<Router>>,
pub fn new<T>(router: T) -> Service where
T: Into<Arc<Router>>,
Create a new Service with a router.
sourcepub fn with_catchers<T>(self, catchers: T) -> Self where
T: Into<Arc<Vec<Box<dyn Catcher>>>>,
pub fn with_catchers<T>(self, catchers: T) -> Self where
T: Into<Arc<Vec<Box<dyn Catcher>>>>,
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.
sourcepub fn with_allowed_media_types<T>(self, allowed_media_types: T) -> Self where
T: Into<Arc<Vec<Mime>>>,
pub fn with_allowed_media_types<T>(self, allowed_media_types: T) -> Self where
T: Into<Arc<Vec<Mime>>>,
Set allowed media types list and returns Self for wite code chained.
sourcepub fn allowed_media_types(&self) -> Arc<Vec<Mime>>
pub fn allowed_media_types(&self) -> Arc<Vec<Mime>>
Get allowed media types list.
Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more