pub enum RequestBody<T> {
None,
Json(T),
Query(T),
Form(T),
Multipart(T),
}
Expand description
What body, if any, should be sent with a request?
Variants§
None
Do not send body or modify URL query parameters at all.
Json(T)
Serialize value as JSON and send it in body.
Query(T)
Serialize value as query string and append it to URL query parameters.
Form(T)
Serialize value as x-www-form-urlencoded and send it in body.
Multipart(T)
Serialize value as multipart/form-data and send it in body.
Trait Implementations§
Source§impl<T: Clone> Clone for RequestBody<T>
impl<T: Clone> Clone for RequestBody<T>
Source§fn clone(&self) -> RequestBody<T>
fn clone(&self) -> RequestBody<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for RequestBody<T>
impl<T: Debug> Debug for RequestBody<T>
Source§impl<T> Default for RequestBody<T>
impl<T> Default for RequestBody<T>
Source§impl<'de, T> Deserialize<'de> for RequestBody<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for RequestBody<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: Hash> Hash for RequestBody<T>
impl<T: Hash> Hash for RequestBody<T>
Source§impl<T: PartialEq> PartialEq for RequestBody<T>
impl<T: PartialEq> PartialEq for RequestBody<T>
Source§impl<T> Serialize for RequestBody<T>where
T: Serialize,
impl<T> Serialize for RequestBody<T>where
T: Serialize,
impl<T: Copy> Copy for RequestBody<T>
impl<T: Eq> Eq for RequestBody<T>
impl<T> StructuralPartialEq for RequestBody<T>
Auto Trait Implementations§
impl<T> Freeze for RequestBody<T>where
T: Freeze,
impl<T> RefUnwindSafe for RequestBody<T>where
T: RefUnwindSafe,
impl<T> Send for RequestBody<T>where
T: Send,
impl<T> Sync for RequestBody<T>where
T: Sync,
impl<T> Unpin for RequestBody<T>where
T: Unpin,
impl<T> UnwindSafe for RequestBody<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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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