pub struct Resp { /* private fields */ }Expand description
A response whose body reads stop when the network it came over changes.
Implementations§
Source§impl Resp
impl Resp
pub fn status(&self) -> StatusCode
pub fn headers(&self) -> &HeaderMap
pub fn content_length(&self) -> Option<u64>
pub fn url(&self) -> &Url
pub fn error_for_status(self) -> Result<Resp, HttpError>
pub async fn chunk(&mut self) -> Result<Option<Bytes>, HttpError>
pub fn bytes_stream(self) -> BodyStream
pub async fn bytes(self) -> Result<Bytes, HttpError>
pub async fn text(self) -> Result<String, HttpError>
pub async fn json<T: DeserializeOwned>(self) -> Result<T, HttpError>
Auto Trait Implementations§
impl !RefUnwindSafe for Resp
impl !UnwindSafe for Resp
impl Forget for Resp
impl Freeze for Resp
impl Move for Resp
impl Send for Resp
impl Sync for Resp
impl Unpin for Resp
impl UnsafeUnpin for Resp
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more