pub struct Response { /* private fields */ }Implementations§
Source§impl Response
impl Response
pub async fn text(self) -> Result<String>
pub async fn text_with_charset(self, default_encoding: &str) -> Result<String>
pub async fn bytes(self) -> Result<Bytes>
pub async fn json<T: DeserializeOwned>(self) -> Result<T>
pub fn into_stream(self) -> Result<BodyStream>
pub async fn copy_to<W>(self, writer: &mut W) -> Result<u64>where
W: AsyncWrite + Unpin,
pub fn into_decoded_stream(self, limit: Option<u64>) -> Result<BodyStream>
pub async fn copy_decoded_to<W>(
self,
writer: &mut W,
limit: Option<u64>,
) -> Result<u64>where
W: AsyncWrite + Unpin,
pub async fn read_until<F>(self, limit: usize, done: F) -> Result<Vec<u8>>
Source§impl Response
impl Response
pub fn status(&self) -> StatusCode
pub fn version(&self) -> HttpVersion
pub fn timing(&self) -> &ResponseTiming
pub fn attempts(&self) -> u32
pub fn proxy(&self) -> Option<&str>
pub fn block(&self) -> Option<BlockSignal>
pub fn url(&self) -> &Url
pub fn redirect_chain(&self) -> &[Url]
pub fn headers(&self) -> &HeaderMap
pub fn trailers(&self) -> impl Iterator<Item = (&HeaderName, &HeaderValue)>
pub fn tls(&self) -> Option<&TlsInfo>
pub fn request_headers(&self) -> impl Iterator<Item = (&str, &str)>
pub fn content_length(&self) -> Option<u64>
pub fn error_for_status(self) -> Result<Self>
pub fn error_for_status_ref(&self) -> Result<&Self>
pub fn audit(&self) -> Option<&AuditData>
pub fn header(&self, name: &str) -> Option<&str>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Response
impl !RefUnwindSafe for Response
impl !UnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin for Response
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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