Struct limiting_factor::api::guards::RequestBody
source · pub struct RequestBody {
pub content: String,
}
Expand description
A String representation of the request body. Useful when you need to pass it through as is.
Fields§
§content: String
The UTF-8 content of the request body
Implementations§
source§impl RequestBody
impl RequestBody
pub fn new() -> Self
sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Convert the request body into a string
sourcepub fn into_optional_string(self) -> Option<String>
pub fn into_optional_string(self) -> Option<String>
Convert the request body into a string, or None if it’s empty
Trait Implementations§
source§impl<'de> Deserialize<'de> for RequestBody
impl<'de> Deserialize<'de> for RequestBody
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 FromDataSimple for RequestBody
impl FromDataSimple for RequestBody
source§impl Ord for RequestBody
impl Ord for RequestBody
source§fn cmp(&self, other: &RequestBody) -> Ordering
fn cmp(&self, other: &RequestBody) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<RequestBody> for RequestBody
impl PartialEq<RequestBody> for RequestBody
source§fn eq(&self, other: &RequestBody) -> bool
fn eq(&self, other: &RequestBody) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<RequestBody> for RequestBody
impl PartialOrd<RequestBody> for RequestBody
source§fn partial_cmp(&self, other: &RequestBody) -> Option<Ordering>
fn partial_cmp(&self, other: &RequestBody) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for RequestBody
impl Serialize for RequestBody
impl Eq for RequestBody
impl StructuralEq for RequestBody
impl StructuralPartialEq for RequestBody
Auto Trait Implementations§
impl RefUnwindSafe for RequestBody
impl Send for RequestBody
impl Sync for RequestBody
impl Unpin for RequestBody
impl UnwindSafe for RequestBody
Blanket Implementations§
source§impl<T> ApiResponse<T> for Twhere
T: Serialize,
impl<T> ApiResponse<T> for Twhere T: Serialize,
source§fn into_json_response(self) -> Result<Json<T>, Status>
fn into_json_response(self) -> Result<Json<T>, Status>
Consumes the value and creates a JSON or a Status result response.
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
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<'a, T> FromData<'a> for Twhere
T: FromDataSimple,
impl<'a, T> FromData<'a> for Twhere T: FromDataSimple,
§type Error = <T as FromDataSimple>::Error
type Error = <T as FromDataSimple>::Error
The associated error to be returned when the guard fails.
§type Owned = Data
type Owned = Data
The owned type returned from
FromData::transform()
. Read more§type Borrowed = Data
type Borrowed = Data
The borrowed type consumed by
FromData::from_data()
when
FromData::transform()
returns a Transform::Borrowed
. Read moresource§fn transform(
_: &Request<'_>,
d: Data
) -> Transform<Outcome<<T as FromData<'a>>::Owned, (Status, <T as FromData<'a>>::Error), Data>, Outcome<<T as FromData<'a>>::Owned, (Status, <T as FromData<'a>>::Error), Data>>
fn transform( _: &Request<'_>, d: Data ) -> Transform<Outcome<<T as FromData<'a>>::Owned, (Status, <T as FromData<'a>>::Error), Data>, Outcome<<T as FromData<'a>>::Owned, (Status, <T as FromData<'a>>::Error), Data>>
source§fn from_data(
req: &Request<'_>,
o: Transform<Outcome<<T as FromData<'a>>::Owned, (Status, <T as FromData<'a>>::Error), Data>, Outcome<&'a <T as FromData<'a>>::Borrowed, (Status, <T as FromData<'a>>::Error), Data>>
) -> Outcome<T, (Status, <T as FromData<'a>>::Error), Data>
fn from_data( req: &Request<'_>, o: Transform<Outcome<<T as FromData<'a>>::Owned, (Status, <T as FromData<'a>>::Error), Data>, Outcome<&'a <T as FromData<'a>>::Borrowed, (Status, <T as FromData<'a>>::Error), Data>> ) -> Outcome<T, (Status, <T as FromData<'a>>::Error), Data>
Validates, parses, and converts the incoming request body data into an
instance of
Self
. Read more§impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
§fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A>where A: Array<Item = T>,
Converts
self
into a collection.