pub struct CallResponse { /* private fields */ }
Expand description
represent a http resonse
Implementations§
Source§impl CallResponse
impl CallResponse
Sourcepub fn to_result(&self) -> GGRResult<&CallResponse>
pub fn to_result(&self) -> GGRResult<&CallResponse>
Converts the response into a result object. This also converts non okay response codes into errors.
Sourcepub fn deserialize<T>(&self) -> GGRResult<T>where
T: DeserializeOwned,
pub fn deserialize<T>(&self) -> GGRResult<T>where
T: DeserializeOwned,
Deserializes the response body into the given type
Sourcepub fn convert<T: DeserializeOwned>(self) -> GGRResult<T>
pub fn convert<T: DeserializeOwned>(self) -> GGRResult<T>
Like deserialize
but consumes the response and will convert
failed requests into proper errors.
Sourcepub fn get_header(&self, key: &str) -> Option<&str>
pub fn get_header(&self, key: &str) -> Option<&str>
Looks up the first matching header for a key.
Trait Implementations§
Source§impl Clone for CallResponse
impl Clone for CallResponse
Source§fn clone(&self) -> CallResponse
fn clone(&self) -> CallResponse
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 moreAuto Trait Implementations§
impl Freeze for CallResponse
impl RefUnwindSafe for CallResponse
impl Send for CallResponse
impl Sync for CallResponse
impl Unpin for CallResponse
impl UnwindSafe for CallResponse
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