pub struct SerdeResponse<T>(/* private fields */);Expand description
Use a Serde value as an HTTP response
Takes a T: serde::Serialize and implements Response for it.
Implementations§
Source§impl<T> SerdeResponse<T>
impl<T> SerdeResponse<T>
Sourcepub fn new(value: T) -> SerdeResponse<T>
pub fn new(value: T) -> SerdeResponse<T>
Create a new SerdeResponse using the given value.
Trait Implementations§
Source§impl<T: Debug> Debug for SerdeResponse<T>
impl<T: Debug> Debug for SerdeResponse<T>
Source§impl<T> Response for SerdeResponse<T>where
T: Serialize,
impl<T> Response for SerdeResponse<T>where
T: Serialize,
Auto Trait Implementations§
impl<T> Freeze for SerdeResponse<T>where
T: Freeze,
impl<T> RefUnwindSafe for SerdeResponse<T>where
T: RefUnwindSafe,
impl<T> Send for SerdeResponse<T>where
T: Send,
impl<T> Sync for SerdeResponse<T>where
T: Sync,
impl<T> Unpin for SerdeResponse<T>where
T: Unpin,
impl<T> UnwindSafe for SerdeResponse<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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