pub struct ApiResponse { /* private fields */ }Expand description
A response from auth::Authenticator::get and its siblings: the status,
the headers and the whole body, as the server sent them.
Implementations§
Source§impl ApiResponse
impl ApiResponse
Sourcepub fn header(&self, name: &str) -> Option<&str>
pub fn header(&self, name: &str) -> Option<&str>
A response header’s value (ETag, …), when present and text.
Sourcepub fn status(&self) -> StatusCode
pub fn status(&self) -> StatusCode
The HTTP status.
Sourcepub fn json<T: DeserializeOwned>(&self) -> Result<T, Error>
pub fn json<T: DeserializeOwned>(&self) -> Result<T, Error>
The body decoded as JSON.
Sourcepub fn sub_status(&self) -> Option<u64>
pub fn sub_status(&self) -> Option<u64>
Tidal’s subStatus from an error body, when it has one.
Trait Implementations§
Source§impl Clone for ApiResponse
impl Clone for ApiResponse
Source§impl Debug for ApiResponse
Shows the status and body length only: a body may echo a token.
impl Debug for ApiResponse
Shows the status and body length only: a body may echo a token.
impl Eq for ApiResponse
Source§impl PartialEq for ApiResponse
impl PartialEq for ApiResponse
impl StructuralPartialEq for ApiResponse
Auto Trait Implementations§
impl Freeze for ApiResponse
impl RefUnwindSafe for ApiResponse
impl Send for ApiResponse
impl Sync for ApiResponse
impl Unpin for ApiResponse
impl UnsafeUnpin for ApiResponse
impl UnwindSafe for ApiResponse
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