Struct salvo::prelude::JsonContent [−][src]
pub struct JsonContent<T>(_);
Expand description
Write serializable content to response as json content. It will set content-type
to application/json; charset=utf-8
.
Trait Implementations
pub fn write<'life0, 'life1, 'life2, 'async_trait>(
self,
_req: &'life0 mut Request,
_depot: &'life1 mut Depot,
res: &'life2 mut Response
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
JsonContent<T>: 'async_trait,
pub fn write<'life0, 'life1, 'life2, 'async_trait>(
self,
_req: &'life0 mut Request,
_depot: &'life1 mut Depot,
res: &'life2 mut Response
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
JsonContent<T>: 'async_trait,
Write data to Respone
.
Auto Trait Implementations
impl<T> RefUnwindSafe for JsonContent<T> where
T: RefUnwindSafe,
impl<T> Send for JsonContent<T> where
T: Send,
impl<T> Sync for JsonContent<T> where
T: Sync,
impl<T> Unpin for JsonContent<T> where
T: Unpin,
impl<T> UnwindSafe for JsonContent<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more