pub struct Request { /* private fields */ }
Expand description
An HTTP request.
§Examples
use http_types::Request;
let mut req = Request::get("https://example.com");
req.set_body("Hello, Nori!");
Implementations§
Source§impl Request
impl Request
Sourcepub fn set_peer_addr(&mut self, peer_addr: Option<impl ToString>)
pub fn set_peer_addr(&mut self, peer_addr: Option<impl ToString>)
Sets a string representation of the peer address of this request. This might take the form of an ip/fqdn and port or a local socket address.
Sourcepub fn set_local_addr(&mut self, local_addr: Option<impl ToString>)
pub fn set_local_addr(&mut self, local_addr: Option<impl ToString>)
Sets a string representation of the local address that this request was received on. This might take the form of an ip/fqdn and port, or a local socket address.
Sourcepub fn peer_addr(&self) -> Option<&str>
pub fn peer_addr(&self) -> Option<&str>
Get the peer socket address for the underlying transport, if that information is available for this request.
Sourcepub fn local_addr(&self) -> Option<&str>
pub fn local_addr(&self) -> Option<&str>
Get the local socket address for the underlying transport, if that information is available for this request.
Sourcepub fn remote(&self) -> Option<&str>
pub fn remote(&self) -> Option<&str>
Get the remote address for this request.
This is determined in the following priority:
Forwarded
headerfor
key- The first
X-Forwarded-For
header - Peer address of the transport
Sourcepub fn host(&self) -> Option<&str>
pub fn host(&self) -> Option<&str>
Get the destination host for this request.
This is determined in the following priority:
Forwarded
headerhost
key- The first
X-Forwarded-Host
header Host
header- URL domain, if any
Sourcepub fn set_method(&mut self, method: Method)
pub fn set_method(&mut self, method: Method)
Set the HTTP method.
Sourcepub fn url(&self) -> &Url
pub fn url(&self) -> &Url
Get a reference to the url.
§Examples
use http_types::{Request, Response, StatusCode};
let mut req = Request::get("https://example.com");
assert_eq!(req.url().scheme(), "https");
Sourcepub fn url_mut(&mut self) -> &mut Url
pub fn url_mut(&mut self) -> &mut Url
Get a mutable reference to the url.
§Examples
use http_types::{Method, Request, Response, StatusCode, Url};
let mut req = Request::get("https://example.com");
req.url_mut().set_scheme("http");
assert_eq!(req.url().scheme(), "http");
Sourcepub fn set_body(&mut self, body: impl Into<Body>)
pub fn set_body(&mut self, body: impl Into<Body>)
Set the request body.
§Examples
use http_types::{Method, Request};
let mut req = Request::get("https://example.com");
req.set_body("Hello, Nori!");
Sourcepub fn replace_body(&mut self, body: impl Into<Body>) -> Body
pub fn replace_body(&mut self, body: impl Into<Body>) -> Body
Swaps the value of the body with another body, without deinitializing either one.
§Examples
use http_types::{Body, Method, Request};
let mut req = Request::get("https://example.com");
req.set_body("Hello, Nori!");
let mut body: Body = req.replace_body("Hello, Chashu!");
let mut string = String::new();
body.read_to_string(&mut string).await?;
assert_eq!(&string, "Hello, Nori!");
Sourcepub fn swap_body(&mut self, body: &mut Body)
pub fn swap_body(&mut self, body: &mut Body)
Replace the request body with a new body, and return the old body.
§Examples
use http_types::{Body, Request};
let mut req = Request::get("https://example.com");
req.set_body("Hello, Nori!");
let mut body = "Hello, Chashu!".into();
req.swap_body(&mut body);
let mut string = String::new();
body.read_to_string(&mut string).await?;
assert_eq!(&string, "Hello, Nori!");
Sourcepub fn take_body(&mut self) -> Body
pub fn take_body(&mut self) -> Body
Take the request body, replacing it with an empty body.
§Examples
use http_types::{Body, Request};
let mut req = Request::get("https://example.com");
req.set_body("Hello, Nori!");
let mut body: Body = req.take_body();
let mut string = String::new();
body.read_to_string(&mut string).await?;
assert_eq!(&string, "Hello, Nori!");
Sourcepub async fn body_string(&mut self) -> Result<String>
pub async fn body_string(&mut self) -> Result<String>
Read the body as a string.
This consumes the request. If you want to read the body without
consuming the request, consider using the take_body
method and
then calling Body::into_string
or using the Request’s AsyncRead
implementation to read the body.
§Examples
use async_std::io::Cursor;
use http_types::{Body, Request};
let mut req = Request::get("https://example.com");
let cursor = Cursor::new("Hello Nori");
let body = Body::from_reader(cursor, None);
req.set_body(body);
assert_eq!(&req.body_string().await.unwrap(), "Hello Nori");
Sourcepub async fn body_bytes(&mut self) -> Result<Vec<u8>>
pub async fn body_bytes(&mut self) -> Result<Vec<u8>>
Read the body as bytes.
This consumes the Request
. If you want to read the body without
consuming the request, consider using the take_body
method and
then calling Body::into_bytes
or using the Request’s AsyncRead
implementation to read the body.
§Examples
use http_types::{Body, Request};
let bytes = vec![1, 2, 3];
let mut req = Request::get("https://example.com");
req.set_body(Body::from_bytes(bytes));
let bytes = req.body_bytes().await?;
assert_eq!(bytes, vec![1, 2, 3]);
Sourcepub async fn body_json<T: DeserializeOwned>(&mut self) -> Result<T>
pub async fn body_json<T: DeserializeOwned>(&mut self) -> Result<T>
Read the body as JSON.
This consumes the request. If you want to read the body without
consuming the request, consider using the take_body
method and
then calling Body::into_json
or using the Request’s AsyncRead
implementation to read the body.
§Examples
use http_types::convert::{Deserialize, Serialize};
use http_types::{Body, Request};
#[derive(Debug, Serialize, Deserialize)]
struct Cat {
name: String,
}
let cat = Cat {
name: String::from("chashu"),
};
let mut req = Request::get("https://example.com");
req.set_body(Body::from_json(&cat)?);
let cat: Cat = req.body_json().await?;
assert_eq!(&cat.name, "chashu");
Sourcepub async fn body_form<T: DeserializeOwned>(&mut self) -> Result<T>
pub async fn body_form<T: DeserializeOwned>(&mut self) -> Result<T>
Read the body as x-www-form-urlencoded
.
This consumes the request. If you want to read the body without
consuming the request, consider using the take_body
method and
then calling Body::into_json
or using the Request’s AsyncRead
implementation to read the body.
§Examples
use http_types::convert::{Deserialize, Serialize};
use http_types::{Body, Request};
#[derive(Debug, Serialize, Deserialize)]
struct Cat {
name: String,
}
let cat = Cat {
name: String::from("chashu"),
};
let mut req = Request::get("https://example.com");
req.set_body(Body::from_form(&cat)?);
let cat: Cat = req.body_form().await?;
assert_eq!(&cat.name, "chashu");
Sourcepub fn header(&self, name: impl Into<HeaderName>) -> Option<&HeaderValues>
pub fn header(&self, name: impl Into<HeaderName>) -> Option<&HeaderValues>
Get an HTTP header.
Sourcepub fn header_mut(
&mut self,
name: impl Into<HeaderName>,
) -> Option<&mut HeaderValues>
pub fn header_mut( &mut self, name: impl Into<HeaderName>, ) -> Option<&mut HeaderValues>
Get a mutable reference to a header.
Sourcepub fn remove_header(
&mut self,
name: impl Into<HeaderName>,
) -> Option<HeaderValues>
pub fn remove_header( &mut self, name: impl Into<HeaderName>, ) -> Option<HeaderValues>
Remove a header.
Sourcepub fn insert_header(
&mut self,
name: impl Into<HeaderName>,
values: impl ToHeaderValues,
) -> Option<HeaderValues>
pub fn insert_header( &mut self, name: impl Into<HeaderName>, values: impl ToHeaderValues, ) -> Option<HeaderValues>
Set an HTTP header.
§Examples
use http_types::Request;
let mut req = Request::get("https://example.com");
req.insert_header("Content-Type", "text/plain");
Sourcepub fn append_header(
&mut self,
name: impl Into<HeaderName>,
values: impl ToHeaderValues,
)
pub fn append_header( &mut self, name: impl Into<HeaderName>, values: impl ToHeaderValues, )
Append a header to the headers.
Unlike insert
this function will not override the contents of a
header, but insert a header if there aren’t any. Or else append to
the existing list of headers.
§Examples
use http_types::Request;
let mut req = Request::get("https://example.com");
req.append_header("Content-Type", "text/plain");
Sourcepub fn set_content_type(&mut self, mime: Mime) -> Option<HeaderValues>
pub fn set_content_type(&mut self, mime: Mime) -> Option<HeaderValues>
Set the response MIME.
Sourcepub fn content_type(&self) -> Option<Mime>
pub fn content_type(&self) -> Option<Mime>
Get the current content type
Sourcepub fn len(&self) -> Option<usize>
pub fn len(&self) -> Option<usize>
Get the length of the body stream, if it has been set.
This value is set when passing a fixed-size object into as the body.
E.g. a string, or a buffer. Consumers of this API should check this
value to decide whether to use Chunked
encoding, or set the
response length.
Sourcepub fn is_empty(&self) -> Option<bool>
pub fn is_empty(&self) -> Option<bool>
Returns true
if the request has a set body stream length of zero,
false
otherwise.
Sourcepub fn version(&self) -> Option<Version>
pub fn version(&self) -> Option<Version>
Get the HTTP version, if one has been set.
§Examples
use http_types::{Request, Version};
let mut req = Request::get("https://example.com");
assert_eq!(req.version(), None);
req.set_version(Some(Version::Http2_0));
assert_eq!(req.version(), Some(Version::Http2_0));
Sourcepub fn set_version(&mut self, version: Option<Version>)
pub fn set_version(&mut self, version: Option<Version>)
Set the HTTP version.
§Examples
use http_types::{Request, Version};
let mut req = Request::get("https://example.com");
req.set_version(Some(Version::Http2_0));
Sourcepub fn send_trailers(&mut self) -> Sender
pub fn send_trailers(&mut self) -> Sender
Sends trailers to the a receiver.
Sourcepub fn recv_trailers(&mut self) -> Receiver ⓘ
pub fn recv_trailers(&mut self) -> Receiver ⓘ
Receive trailers from a sender.
Sourcepub fn has_trailers(&self) -> bool
pub fn has_trailers(&self) -> bool
Returns true
if sending trailers is in progress.
Sourcepub fn iter_mut(&mut self) -> IterMut<'_> ⓘ
pub fn iter_mut(&mut self) -> IterMut<'_> ⓘ
An iterator visiting all header pairs in arbitrary order, with mutable references to the values.
Sourcepub fn header_names(&self) -> Names<'_> ⓘ
pub fn header_names(&self) -> Names<'_> ⓘ
An iterator visiting all header names in arbitrary order.
Sourcepub fn header_values(&self) -> Values<'_> ⓘ
pub fn header_values(&self) -> Values<'_> ⓘ
An iterator visiting all header values in arbitrary order.
Sourcepub fn ext(&self) -> &Extensions
pub fn ext(&self) -> &Extensions
Returns a reference to the existing local state.
Sourcepub fn ext_mut(&mut self) -> &mut Extensions
pub fn ext_mut(&mut self) -> &mut Extensions
Returns a mutuable reference to the existing local state.
§Examples
use http_types::{Request, Version};
let mut req = Request::get("https://example.com");
req.ext_mut().insert("hello from the extension");
assert_eq!(req.ext().get(), Some(&"hello from the extension"));
Sourcepub fn query<'de, T: Deserialize<'de>>(&'de self) -> Result<T>
pub fn query<'de, T: Deserialize<'de>>(&'de self) -> Result<T>
Get the URL querystring.
§Examples
use http_types::convert::Deserialize;
use http_types::Request;
use std::collections::HashMap;
// An owned structure:
#[derive(Deserialize)]
struct Index {
page: u32,
selections: HashMap<String, String>,
}
let mut req = Request::get("https://httpbin.org/get?page=2&selections[width]=narrow&selections[height]=tall");
let Index { page, selections } = req.query().unwrap();
assert_eq!(page, 2);
assert_eq!(selections["width"], "narrow");
assert_eq!(selections["height"], "tall");
// Using borrows:
#[derive(Deserialize)]
struct Query<'q> {
format: &'q str,
}
let mut req = Request::get("https://httpbin.org/get?format=bananna");
let Query { format } = req.query().unwrap();
assert_eq!(format, "bananna");
Sourcepub fn set_query(&mut self, query: &impl Serialize) -> Result<()>
pub fn set_query(&mut self, query: &impl Serialize) -> Result<()>
Set the URL querystring.
§Examples
use http_types::convert::Serialize;
use http_types::{Method, Request};
use std::collections::HashMap;
#[derive(Serialize)]
struct Index {
page: u32,
topics: Vec<&'static str>,
}
let query = Index { page: 2, topics: vec!["rust", "crabs", "crustaceans"] };
let mut req = Request::get("https://httpbin.org/get");
req.set_query(&query).unwrap();
assert_eq!(req.url().query(), Some("page=2&topics[0]=rust&topics[1]=crabs&topics[2]=crustaceans"));
Sourcepub fn get<U>(url: U) -> Self
pub fn get<U>(url: U) -> Self
Create a GET
request.
The GET
method requests a representation of the specified resource.
Requests using GET
should only retrieve data.
§Examples
use http_types::{Method, Request};
let mut req = Request::get("https://example.com");
req.set_body("Hello, Nori!");
assert_eq!(req.method(), Method::Get);
Sourcepub fn head<U>(url: U) -> Self
pub fn head<U>(url: U) -> Self
Create a HEAD
request.
The HEAD
method asks for a response identical to that of a GET
request, but without the response body.
§Examples
use http_types::{Method, Request};
let mut req = Request::head("https://example.com");
assert_eq!(req.method(), Method::Head);
Sourcepub fn post<U>(url: U) -> Self
pub fn post<U>(url: U) -> Self
Create a POST
request.
The POST
method is used to submit an entity to the specified resource,
often causing a change in state or side effects on the server.
§Examples
use http_types::{Method, Request};
let mut req = Request::post("https://example.com");
assert_eq!(req.method(), Method::Post);
Sourcepub fn put<U>(url: U) -> Self
pub fn put<U>(url: U) -> Self
Create a PUT
request.
The PUT
method replaces all current representations of the target
resource with the request payload.
§Examples
use http_types::{Method, Request};
let mut req = Request::put("https://example.com");
assert_eq!(req.method(), Method::Put);
Sourcepub fn delete<U>(url: U) -> Self
pub fn delete<U>(url: U) -> Self
Create a DELETE
request.
The DELETE
method deletes the specified resource.
§Examples
use http_types::{Method, Request};
let mut req = Request::delete("https://example.com");
assert_eq!(req.method(), Method::Delete);
Sourcepub fn connect<U>(url: U) -> Self
pub fn connect<U>(url: U) -> Self
Create a CONNECT
request.
The CONNECT
method establishes a tunnel to the server identified by
the target resource.
§Examples
use http_types::{Method, Request};
let mut req = Request::connect("https://example.com");
assert_eq!(req.method(), Method::Connect);
Sourcepub fn options<U>(url: U) -> Self
pub fn options<U>(url: U) -> Self
Create a OPTIONS
request.
The OPTIONS
method is used to describe the communication options for
the target resource.
§Examples
use http_types::{Method, Request};
let mut req = Request::options("https://example.com");
assert_eq!(req.method(), Method::Options);
Sourcepub fn trace<U>(url: U) -> Self
pub fn trace<U>(url: U) -> Self
Create a TRACE
request.
The TRACE
method performs a message loop-back test along the path to
the target resource.
§Examples
use http_types::{Method, Request};
let mut req = Request::trace("https://example.com");
assert_eq!(req.method(), Method::Trace);
Trait Implementations§
Source§impl AsyncBufRead for Request
impl AsyncBufRead for Request
Source§impl AsyncRead for Request
impl AsyncRead for Request
Source§impl Index<&str> for Request
impl Index<&str> for Request
Source§fn index(&self, name: &str) -> &HeaderValues
fn index(&self, name: &str) -> &HeaderValues
Returns a reference to the value corresponding to the supplied name.
§Panics
Panics if the name is not present in Request
.
Source§type Output = HeaderValues
type Output = HeaderValues
Source§impl Index<HeaderName> for Request
impl Index<HeaderName> for Request
Source§fn index(&self, name: HeaderName) -> &HeaderValues
fn index(&self, name: HeaderName) -> &HeaderValues
Returns a reference to the value corresponding to the supplied name.
§Panics
Panics if the name is not present in Request
.
Source§type Output = HeaderValues
type Output = HeaderValues
Source§impl<'a> IntoIterator for &'a Request
impl<'a> IntoIterator for &'a Request
Source§impl<'a> IntoIterator for &'a mut Request
impl<'a> IntoIterator for &'a mut Request
Source§impl IntoIterator for Request
impl IntoIterator for Request
impl<'__pin> Unpin for Requestwhere
PinnedFieldsOf<__Origin<'__pin>>: Unpin,
Auto Trait Implementations§
impl Freeze for Request
impl !RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl !UnwindSafe for Request
Blanket Implementations§
Source§impl<R> AsyncBufReadExt for Rwhere
R: AsyncBufRead + ?Sized,
impl<R> AsyncBufReadExt for Rwhere
R: AsyncBufRead + ?Sized,
Source§fn fill_buf(&mut self) -> FillBuf<'_, Self>where
Self: Unpin,
fn fill_buf(&mut self) -> FillBuf<'_, Self>where
Self: Unpin,
Source§fn read_until<'a>(
&'a mut self,
byte: u8,
buf: &'a mut Vec<u8>,
) -> ReadUntilFuture<'a, Self>where
Self: Unpin,
fn read_until<'a>(
&'a mut self,
byte: u8,
buf: &'a mut Vec<u8>,
) -> ReadUntilFuture<'a, Self>where
Self: Unpin,
Source§fn read_line<'a>(&'a mut self, buf: &'a mut String) -> ReadLineFuture<'a, Self>where
Self: Unpin,
fn read_line<'a>(&'a mut self, buf: &'a mut String) -> ReadLineFuture<'a, Self>where
Self: Unpin,
buf
until a newline (the 0xA byte) or EOF is found. Read moreSource§impl<R> AsyncBufReadExt for Rwhere
R: AsyncBufRead + ?Sized,
impl<R> AsyncBufReadExt for Rwhere
R: AsyncBufRead + ?Sized,
Source§fn fill_buf(&mut self) -> FillBuf<'_, Self>where
Self: Unpin,
fn fill_buf(&mut self) -> FillBuf<'_, Self>where
Self: Unpin,
Source§fn read_until<'a>(
&'a mut self,
byte: u8,
buf: &'a mut Vec<u8>,
) -> ReadUntilFuture<'a, Self>where
Self: Unpin,
fn read_until<'a>(
&'a mut self,
byte: u8,
buf: &'a mut Vec<u8>,
) -> ReadUntilFuture<'a, Self>where
Self: Unpin,
Source§fn read_line<'a>(&'a mut self, buf: &'a mut String) -> ReadLineFuture<'a, Self>where
Self: Unpin,
fn read_line<'a>(&'a mut self, buf: &'a mut String) -> ReadLineFuture<'a, Self>where
Self: Unpin,
buf
until a newline (the 0xA byte) or EOF is found. Read moreSource§impl<R> AsyncReadExt for R
impl<R> AsyncReadExt for R
Source§fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self>where
Self: Unpin,
fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self>where
Self: Unpin,
Source§fn read_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>],
) -> ReadVectoredFuture<'a, Self>where
Self: Unpin,
fn read_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>],
) -> ReadVectoredFuture<'a, Self>where
Self: Unpin,
Source§fn read_to_end<'a>(
&'a mut self,
buf: &'a mut Vec<u8>,
) -> ReadToEndFuture<'a, Self>where
Self: Unpin,
fn read_to_end<'a>(
&'a mut self,
buf: &'a mut Vec<u8>,
) -> ReadToEndFuture<'a, Self>where
Self: Unpin,
Source§fn read_to_string<'a>(
&'a mut self,
buf: &'a mut String,
) -> ReadToStringFuture<'a, Self>where
Self: Unpin,
fn read_to_string<'a>(
&'a mut self,
buf: &'a mut String,
) -> ReadToStringFuture<'a, Self>where
Self: Unpin,
Source§fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self>where
Self: Unpin,
fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self>where
Self: Unpin,
buf
. Read moreSource§fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
limit
bytes from it. Read moreSource§impl<R> AsyncReadExt for R
impl<R> AsyncReadExt for R
Source§fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self>where
Self: Unpin,
fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self>where
Self: Unpin,
Source§fn read_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>],
) -> ReadVectoredFuture<'a, Self>where
Self: Unpin,
fn read_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>],
) -> ReadVectoredFuture<'a, Self>where
Self: Unpin,
Source§fn read_to_end<'a>(
&'a mut self,
buf: &'a mut Vec<u8>,
) -> ReadToEndFuture<'a, Self>where
Self: Unpin,
fn read_to_end<'a>(
&'a mut self,
buf: &'a mut Vec<u8>,
) -> ReadToEndFuture<'a, Self>where
Self: Unpin,
Source§fn read_to_string<'a>(
&'a mut self,
buf: &'a mut String,
) -> ReadToStringFuture<'a, Self>where
Self: Unpin,
fn read_to_string<'a>(
&'a mut self,
buf: &'a mut String,
) -> ReadToStringFuture<'a, Self>where
Self: Unpin,
Source§fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self>where
Self: Unpin,
fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self>where
Self: Unpin,
buf
. Read moreSource§fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
limit
bytes from it. Read moreSource§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
Source§impl<T> BufReadExt for Twhere
T: AsyncBufRead + ?Sized,
impl<T> BufReadExt for Twhere
T: AsyncBufRead + ?Sized,
Source§fn read_until<'a>(
&'a mut self,
byte: u8,
buf: &'a mut Vec<u8>,
) -> ReadUntilFuture<'a, Self>where
Self: Unpin,
fn read_until<'a>(
&'a mut self,
byte: u8,
buf: &'a mut Vec<u8>,
) -> ReadUntilFuture<'a, Self>where
Self: Unpin,
Source§fn read_line<'a>(&'a mut self, buf: &'a mut String) -> ReadLineFuture<'a, Self>where
Self: Unpin,
fn read_line<'a>(&'a mut self, buf: &'a mut String) -> ReadLineFuture<'a, Self>where
Self: Unpin,
buf
until a newline (the 0xA byte) is
reached. Read moreSource§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ReadExt for T
impl<T> ReadExt for T
Source§fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self>where
Self: Unpin,
fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self>where
Self: Unpin,
Source§fn read_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>],
) -> ReadVectoredFuture<'a, Self>where
Self: Unpin,
fn read_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>],
) -> ReadVectoredFuture<'a, Self>where
Self: Unpin,
Source§fn read_to_end<'a>(
&'a mut self,
buf: &'a mut Vec<u8>,
) -> ReadToEndFuture<'a, Self>where
Self: Unpin,
fn read_to_end<'a>(
&'a mut self,
buf: &'a mut Vec<u8>,
) -> ReadToEndFuture<'a, Self>where
Self: Unpin,
Source§fn read_to_string<'a>(
&'a mut self,
buf: &'a mut String,
) -> ReadToStringFuture<'a, Self>where
Self: Unpin,
fn read_to_string<'a>(
&'a mut self,
buf: &'a mut String,
) -> ReadToStringFuture<'a, Self>where
Self: Unpin,
Source§fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self>where
Self: Unpin,
fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self>where
Self: Unpin,
buf
. Read moreSource§fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
limit
bytes from it. Read moreSource§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Read
. Read more