pub struct OwnedDownloadResponse {
pub data: Vec<u8>,
pub status_code: u16,
pub headers: HashMap<String, String>,
}Fields§
§data: Vec<u8>§status_code: u16§headers: HashMap<String, String>Implementations§
source§impl OwnedDownloadResponse
impl OwnedDownloadResponse
sourcepub fn text(&self) -> Result<String, FromUtf8Error>
pub fn text(&self) -> Result<String, FromUtf8Error>
Attempt to parse the response body as UTF-8.
sourcepub fn json<T: DeserializeOwned>(&self) -> Result<T, Error>
pub fn json<T: DeserializeOwned>(&self) -> Result<T, Error>
Attempt to deserialize the response body as JSON into T.
sourcepub fn header(&self, name: &str) -> Option<&str>
pub fn header(&self, name: &str) -> Option<&str>
Convenience to get a header value by case-insensitive name.
sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
True if the status code is in the 2xx range.
Auto Trait Implementations§
impl Freeze for OwnedDownloadResponse
impl RefUnwindSafe for OwnedDownloadResponse
impl Send for OwnedDownloadResponse
impl Sync for OwnedDownloadResponse
impl Unpin for OwnedDownloadResponse
impl UnwindSafe for OwnedDownloadResponse
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