Enum tusk_rs::reqres::BodyContents
source · pub enum BodyContents {
Binary(Vec<u8>),
JsonObject(JsonObject),
JsonArray(JsonArray),
UrlEncoded(UrlEncoded),
PlainText(String),
None,
}
Variants§
Binary(Vec<u8>)
JsonObject(JsonObject)
JsonArray(JsonArray)
UrlEncoded(UrlEncoded)
PlainText(String)
None
Implementations§
source§impl BodyContents
impl BodyContents
pub fn type_from_mime(mime: &str, data: Vec<u8>) -> BodyContents
pub fn to_json_object(&self) -> Result<&JsonObject, RouteError>
pub fn to_json_array(&self) -> Result<&JsonArray, RouteError>
pub fn into_json_object(self) -> Result<JsonObject, RouteError>
pub fn into_json_array(self) -> Result<JsonArray, RouteError>
pub fn url_encoded(&self) -> Result<&UrlEncoded, RouteError>
pub fn as_url_encoded(self) -> UrlEncoded
pub fn as_bytes(self) -> Vec<u8>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BodyContents
impl RefUnwindSafe for BodyContents
impl Send for BodyContents
impl Sync for BodyContents
impl Unpin for BodyContents
impl UnwindSafe for BodyContents
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