pub struct EmptyBody<const TRULY_EMPTY: bool = true>;Available on crate feature
api only.Expand description
“Empty” body type, used mostly for GET requests.
If TRULY_EMPTY is true, serializes to an empty buffer.
If TRULY_EMPTY is false, serializes to an empty JSON object.
(that case is not encoded as a separate type due to macro requirements)
Trait Implementations§
Source§impl<const TRULY_EMPTY: bool> OutgoingBody for EmptyBody<TRULY_EMPTY>
impl<const TRULY_EMPTY: bool> OutgoingBody for EmptyBody<TRULY_EMPTY>
Source§type Error = Infallible
type Error = Infallible
The type of error that can happen in
try_info_buf.Source§fn try_into_buf<T: Default + BufMut + AsRef<[u8]>>(
self,
) -> Result<T, Infallible>
fn try_into_buf<T: Default + BufMut + AsRef<[u8]>>( self, ) -> Result<T, Infallible>
Turn
self into a byte buffer (copying a raw body or serializing a JSON one).Auto Trait Implementations§
impl<const TRULY_EMPTY: bool> Freeze for EmptyBody<TRULY_EMPTY>
impl<const TRULY_EMPTY: bool> RefUnwindSafe for EmptyBody<TRULY_EMPTY>
impl<const TRULY_EMPTY: bool> Send for EmptyBody<TRULY_EMPTY>
impl<const TRULY_EMPTY: bool> Sync for EmptyBody<TRULY_EMPTY>
impl<const TRULY_EMPTY: bool> Unpin for EmptyBody<TRULY_EMPTY>
impl<const TRULY_EMPTY: bool> UnsafeUnpin for EmptyBody<TRULY_EMPTY>
impl<const TRULY_EMPTY: bool> UnwindSafe for EmptyBody<TRULY_EMPTY>
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