Enum apisdk::ResponseBody
source · pub enum ResponseBody {
Json(Value),
Xml(String),
Text(String),
}
Expand description
This enum represents the payload of respones
Variants§
Json(Value)
Json (content-type = application/json)
Xml(String)
Xml (content-type = text/xml | application/xml)
Text(String)
Text (content-type = text/plain | text/html | text/*)
Implementations§
source§impl ResponseBody
impl ResponseBody
sourcepub fn parse_json<T>(self) -> ApiResult<T>where
T: DeserializeOwned,
pub fn parse_json<T>(self) -> ApiResult<T>where
T: DeserializeOwned,
Parse as json to target type
sourcepub fn parse_xml<T>(self) -> ApiResult<T>where
T: DeserializeOwned,
pub fn parse_xml<T>(self) -> ApiResult<T>where
T: DeserializeOwned,
Parse as xml to target type
Trait Implementations§
source§impl Clone for ResponseBody
impl Clone for ResponseBody
source§fn clone(&self) -> ResponseBody
fn clone(&self) -> ResponseBody
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 Debug for ResponseBody
impl Debug for ResponseBody
source§impl TryFrom<ResponseBody> for CodeDataMessage
impl TryFrom<ResponseBody> for CodeDataMessage
source§impl TryFrom<ResponseBody> for String
impl TryFrom<ResponseBody> for String
Auto Trait Implementations§
impl RefUnwindSafe for ResponseBody
impl Send for ResponseBody
impl Sync for ResponseBody
impl Unpin for ResponseBody
impl UnwindSafe for ResponseBody
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