[−][src]Struct tide::http::Request
An HTTP request.
Examples
use http_types::{Url, Method, Request}; let mut req = Request::new(Method::Get, Url::parse("https://example.com").unwrap()); req.set_body("Hello, Nori!");
Implementations
impl Request
[src]
pub fn new<U>(method: Method, url: U) -> Request where
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
[src]
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
Create a new request.
pub fn set_peer_addr(&mut self, peer_addr: Option<impl ToString>)
[src]
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.
pub fn set_local_addr(&mut self, local_addr: Option<impl ToString>)
[src]
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.
pub fn peer_addr(&self) -> Option<&str>
[src]
Get the peer socket address for the underlying transport, if that information is available for this request.
pub fn local_addr(&self) -> Option<&str>
[src]
Get the local socket address for the underlying transport, if that information is available for this request.
pub fn remote(&self) -> Option<&str>
[src]
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
pub fn host(&self) -> Option<&str>
[src]
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
pub fn method(&self) -> Method
[src]
Get the HTTP method
pub fn set_method(&mut self, method: Method)
[src]
Set the HTTP method.
pub fn url(&self) -> &Url
[src]
Get a reference to the url.
Examples
use http_types::{Method, Request, Response, StatusCode, Url}; let mut req = Request::new(Method::Get, Url::parse("https://example.com")?); assert_eq!(req.url().scheme(), "https");
pub fn url_mut(&mut self) -> &mut Url
[src]
Get a mutable reference to the url.
Examples
use http_types::{Method, Request, Response, StatusCode, Url}; let mut req = Request::new(Method::Get, Url::parse("https://example.com")?); req.url_mut().set_scheme("http"); assert_eq!(req.url().scheme(), "http");
pub fn set_body(&mut self, body: impl Into<Body>)
[src]
Set the request body.
Examples
use http_types::{Method, Request, Url}; let mut req = Request::new(Method::Get, Url::parse("https://example.com").unwrap()); req.set_body("Hello, Nori!");
pub fn replace_body(&mut self, body: impl Into<Body>) -> Body
[src]
Swaps the value of the body with another body, without deinitializing either one.
Examples
use http_types::{Body, Method, Request, Url}; let mut req = Request::new(Method::Get, Url::parse("https://example.com").unwrap()); 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!");
pub fn swap_body(&mut self, body: &mut Body)
[src]
Replace the request body with a new body, and return the old body.
Examples
use http_types::{Body, Method, Request, Url}; let mut req = Request::new(Method::Get, Url::parse("https://example.com").unwrap()); 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!");
pub fn take_body(&mut self) -> Body
[src]
Take the request body, replacing it with an empty body.
Examples
use http_types::{Body, Method, Request, Url}; let mut req = Request::new(Method::Get, Url::parse("https://example.com").unwrap()); 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!");
pub async fn body_string(&'_ mut self) -> Result<String, Error>
[src]
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, Method, Request, Url}; let mut req = Request::new(Method::Get, Url::parse("https://example.com").unwrap()); 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");
pub async fn body_bytes(&'_ mut self) -> Result<Vec<u8, Global>, Error>
[src]
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, Method, Request, Url}; let bytes = vec![1, 2, 3]; let mut req = Request::new(Method::Get, Url::parse("https://example.com").unwrap()); req.set_body(Body::from_bytes(bytes)); let bytes = req.body_bytes().await?; assert_eq!(bytes, vec![1, 2, 3]);
pub async fn body_json<T>(&'_ mut self) -> Result<T, Error> where
T: DeserializeOwned,
[src]
T: DeserializeOwned,
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, Method, Request, Url}; #[derive(Debug, Serialize, Deserialize)] struct Cat { name: String, } let cat = Cat { name: String::from("chashu"), }; let mut req = Request::new(Method::Get, Url::parse("https://example.com").unwrap()); req.set_body(Body::from_json(&cat)?); let cat: Cat = req.body_json().await?; assert_eq!(&cat.name, "chashu");
pub async fn body_form<T>(&'_ mut self) -> Result<T, Error> where
T: DeserializeOwned,
[src]
T: DeserializeOwned,
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, Method, Request, Url}; #[derive(Debug, Serialize, Deserialize)] struct Cat { name: String, } let cat = Cat { name: String::from("chashu"), }; let mut req = Request::new(Method::Get, Url::parse("https://example.com").unwrap()); req.set_body(Body::from_form(&cat)?); let cat: Cat = req.body_form().await?; assert_eq!(&cat.name, "chashu");
pub fn header(&self, name: impl Into<HeaderName>) -> Option<&HeaderValues>
[src]
Get an HTTP header.
pub fn header_mut(
&mut self,
name: impl Into<HeaderName>
) -> Option<&mut HeaderValues>
[src]
&mut self,
name: impl Into<HeaderName>
) -> Option<&mut HeaderValues>
Get a mutable reference to a header.
pub fn remove_header(
&mut self,
name: impl Into<HeaderName>
) -> Option<HeaderValues>
[src]
&mut self,
name: impl Into<HeaderName>
) -> Option<HeaderValues>
Remove a header.
pub fn insert_header(
&mut self,
name: impl Into<HeaderName>,
values: impl ToHeaderValues
) -> Option<HeaderValues>
[src]
&mut self,
name: impl Into<HeaderName>,
values: impl ToHeaderValues
) -> Option<HeaderValues>
Set an HTTP header.
Examples
use http_types::{Method, Request, Url}; let mut req = Request::new(Method::Get, Url::parse("https://example.com")?); req.insert_header("Content-Type", "text/plain");
pub fn append_header(
&mut self,
name: impl Into<HeaderName>,
values: impl ToHeaderValues
)
[src]
&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::{Method, Request, Url}; let mut req = Request::new(Method::Get, Url::parse("https://example.com")?); req.append_header("Content-Type", "text/plain");
pub fn set_content_type(&mut self, mime: Mime) -> Option<HeaderValues>
[src]
Set the response MIME.
pub fn content_type(&self) -> Option<Mime>
[src]
Get the current content type
pub fn len(&self) -> Option<usize>
[src]
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.
pub fn is_empty(&self) -> Option<bool>
[src]
Returns true
if the request has a set body stream length of zero,
false
otherwise.
pub fn version(&self) -> Option<Version>
[src]
Get the HTTP version, if one has been set.
Examples
use http_types::{Method, Request, Url, Version}; let mut req = Request::new(Method::Get, Url::parse("https://example.com")?); assert_eq!(req.version(), None); req.set_version(Some(Version::Http2_0)); assert_eq!(req.version(), Some(Version::Http2_0));
pub fn set_version(&mut self, version: Option<Version>)
[src]
Set the HTTP version.
Examples
use http_types::{Method, Request, Url, Version}; let mut req = Request::new(Method::Get, Url::parse("https://example.com")?); req.set_version(Some(Version::Http2_0));
pub fn send_trailers(&mut self) -> Sender
[src]
Sends trailers to the a receiver.
pub fn recv_trailers(&mut self) -> Receiverⓘ
[src]
Receive trailers from a sender.
pub fn has_trailers(&self) -> bool
[src]
Returns true
if sending trailers is in progress.
pub fn iter(&self) -> Iter<'_>ⓘNotable traits for Iter<'a>
impl<'a> Iterator for Iter<'a> type Item = (&'a HeaderName, &'a HeaderValues);
[src]
Notable traits for Iter<'a>
impl<'a> Iterator for Iter<'a> type Item = (&'a HeaderName, &'a HeaderValues);
An iterator visiting all header pairs in arbitrary order.
pub fn iter_mut(&mut self) -> IterMut<'_>ⓘNotable traits for IterMut<'a>
impl<'a> Iterator for IterMut<'a> type Item = (&'a HeaderName, &'a mut HeaderValues);
[src]
Notable traits for IterMut<'a>
impl<'a> Iterator for IterMut<'a> type Item = (&'a HeaderName, &'a mut HeaderValues);
An iterator visiting all header pairs in arbitrary order, with mutable references to the values.
pub fn header_names(&self) -> Names<'_>ⓘNotable traits for Names<'a>
impl<'a> Iterator for Names<'a> type Item = &'a HeaderName;
[src]
Notable traits for Names<'a>
impl<'a> Iterator for Names<'a> type Item = &'a HeaderName;
An iterator visiting all header names in arbitrary order.
pub fn header_values(&self) -> Values<'_>ⓘNotable traits for Values<'a>
impl<'a> Iterator for Values<'a> type Item = &'a HeaderValue;
[src]
Notable traits for Values<'a>
impl<'a> Iterator for Values<'a> type Item = &'a HeaderValue;
An iterator visiting all header values in arbitrary order.
pub fn ext(&self) -> &Extensions
[src]
Returns a reference to the existing local state.
pub fn ext_mut(&mut self) -> &mut Extensions
[src]
Returns a mutuable reference to the existing local state.
Examples
use http_types::{Method, Request, Url, Version}; let mut req = Request::new(Method::Get, Url::parse("https://example.com")?); req.ext_mut().insert("hello from the extension"); assert_eq!(req.ext().get(), Some(&"hello from the extension"));
pub fn query<T>(&self) -> Result<T, Error> where
T: DeserializeOwned,
[src]
T: DeserializeOwned,
Get the URL querystring.
Examples
use http_types::convert::Deserialize; use http_types::{Method, Request, Url}; use std::collections::HashMap; #[derive(Deserialize)] struct Index { page: u32, selections: HashMap<String, String>, } let req = Request::new( Method::Get, Url::parse("https://httpbin.org/get?page=2&selections[width]=narrow&selections[height]=tall").unwrap(), ); let Index { page, selections } = req.query().unwrap(); assert_eq!(page, 2); assert_eq!(selections["width"], "narrow"); assert_eq!(selections["height"], "tall");
pub fn set_query(&mut self, query: &impl Serialize) -> Result<(), Error>
[src]
Set the URL querystring.
Examples
use http_types::convert::Serialize; use http_types::{Method, Request, Url}; 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::new( Method::Get, Url::parse("https://httpbin.org/get").unwrap(), ); req.set_query(&query).unwrap(); assert_eq!(req.url().query(), Some("page=2&topics[0]=rust&topics[1]=crabs&topics[2]=crustaceans"));
pub fn get<U>(url: U) -> Request where
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
[src]
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
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, Url}; let mut req = Request::get("https://example.com"); req.set_body("Hello, Nori!"); assert_eq!(req.method(), Method::Get);
pub fn head<U>(url: U) -> Request where
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
[src]
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
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, Url}; let mut req = Request::head("https://example.com"); assert_eq!(req.method(), Method::Head);
pub fn post<U>(url: U) -> Request where
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
[src]
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
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, Url}; let mut req = Request::post("https://example.com"); assert_eq!(req.method(), Method::Post);
pub fn put<U>(url: U) -> Request where
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
[src]
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
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, Url}; let mut req = Request::put("https://example.com"); assert_eq!(req.method(), Method::Put);
pub fn delete<U>(url: U) -> Request where
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
[src]
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
Create a DELETE
request.
The DELETE
method deletes the specified resource.
Examples
use http_types::{Method, Request, Url}; let mut req = Request::delete("https://example.com"); assert_eq!(req.method(), Method::Delete);
pub fn connect<U>(url: U) -> Request where
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
[src]
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
Create a CONNECT
request.
The CONNECT
method establishes a tunnel to the server identified by
the target resource.
Examples
use http_types::{Method, Request, Url}; let mut req = Request::connect("https://example.com"); assert_eq!(req.method(), Method::Connect);
pub fn options<U>(url: U) -> Request where
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
[src]
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
Create a OPTIONS
request.
The OPTIONS
method is used to describe the communication options for
the target resource.
Examples
use http_types::{Method, Request, Url}; let mut req = Request::options("https://example.com"); assert_eq!(req.method(), Method::Options);
pub fn trace<U>(url: U) -> Request where
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
[src]
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
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, Url}; let mut req = Request::trace("https://example.com"); assert_eq!(req.method(), Method::Trace);
pub fn patch<U>(url: U) -> Request where
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
[src]
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
Create a PATCH
request.
The PATCH
method is used to apply partial modifications to a resource.
Examples
use http_types::{Method, Request, Url}; let mut req = Request::patch("https://example.com"); assert_eq!(req.method(), Method::Patch);
Trait Implementations
impl AsMut<Headers> for Request
[src]
impl<State> AsMut<Request> for Request<State>
[src]
impl AsRef<Headers> for Request
[src]
impl<State> AsRef<Request> for Request<State>
[src]
impl AsyncBufRead for Request
[src]
pub fn poll_fill_buf(
self: Pin<&mut Request>,
cx: &mut Context<'_>
) -> Poll<Result<&[u8], Error>>
[src]
self: Pin<&mut Request>,
cx: &mut Context<'_>
) -> Poll<Result<&[u8], Error>>
pub fn consume(self: Pin<&mut Request>, amt: usize)
[src]
impl AsyncRead for Request
[src]
pub fn poll_read(
self: Pin<&mut Request>,
cx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Request>,
cx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
pub fn poll_read_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &mut [IoSliceMut<'_>]
) -> Poll<Result<usize, Error>>
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &mut [IoSliceMut<'_>]
) -> Poll<Result<usize, Error>>
impl Clone for Request
[src]
pub fn clone(&self) -> Request
[src]
Clone the request, resolving the body to Body::empty()
and removing
extensions.
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Request
[src]
impl From<Request> for Body
[src]
impl<'_> Index<&'_ str> for Request
[src]
type Output = HeaderValues
The returned type after indexing.
pub fn index(&self, name: &str) -> &HeaderValues
[src]
Returns a reference to the value corresponding to the supplied name.
Panics
Panics if the name is not present in Request
.
impl Index<HeaderName> for Request
[src]
type Output = HeaderValues
The returned type after indexing.
pub fn index(&self, name: HeaderName) -> &HeaderValues
[src]
Returns a reference to the value corresponding to the supplied name.
Panics
Panics if the name is not present in Request
.
impl<State: Default> Into<Request<State>> for Request
[src]
impl<State> Into<Request> for Request<State>
[src]
impl IntoIterator for Request
[src]
type Item = (HeaderName, HeaderValues)
The type of the elements being iterated over.
type IntoIter = IntoIter
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> <Request as IntoIterator>::IntoIter
[src]
Returns a iterator of references over the remaining items.
impl<'a> IntoIterator for &'a Request
[src]
type Item = (&'a HeaderName, &'a HeaderValues)
The type of the elements being iterated over.
type IntoIter = Iter<'a>
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> <&'a Request as IntoIterator>::IntoIter
[src]
impl<'a> IntoIterator for &'a mut Request
[src]
type Item = (&'a HeaderName, &'a mut HeaderValues)
The type of the elements being iterated over.
type IntoIter = IterMut<'a>
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> <&'a mut Request as IntoIterator>::IntoIter
[src]
impl<'__pin> Unpin for Request where
__Origin<'__pin>: Unpin,
[src]
__Origin<'__pin>: Unpin,
Auto Trait Implementations
impl !RefUnwindSafe for Request
[src]
impl Send for Request
[src]
impl Sync for Request
[src]
impl !UnwindSafe for Request
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<R> AsyncBufReadExt for R where
R: AsyncBufRead + ?Sized,
R: AsyncBufRead + ?Sized,
pub fn fill_buf(&mut self) -> FillBuf<'_, Self> where
Self: Unpin,
Self: Unpin,
pub fn consume(&mut self, amt: usize) where
Self: Unpin,
Self: Unpin,
pub fn read_until(
&'a mut self,
byte: u8,
buf: &'a mut Vec<u8, Global>
) -> ReadUntilFuture<'a, Self> where
Self: Unpin,
&'a mut self,
byte: u8,
buf: &'a mut Vec<u8, Global>
) -> ReadUntilFuture<'a, Self> where
Self: Unpin,
pub fn read_line(&'a mut self, buf: &'a mut String) -> ReadLineFuture<'a, Self> where
Self: Unpin,
Self: Unpin,
pub fn lines(self) -> Lines<Self> where
Self: Unpin,
Self: Unpin,
pub fn split(self, byte: u8) -> Split<Self>
impl<R> AsyncBufReadExt for R where
R: AsyncBufRead + ?Sized,
[src]
R: AsyncBufRead + ?Sized,
pub fn fill_buf(&mut self) -> FillBuf<'_, Self> where
Self: Unpin,
[src]
Self: Unpin,
pub fn consume_unpin(&mut self, amt: usize) where
Self: Unpin,
[src]
Self: Unpin,
pub fn read_until(
&'a mut self,
byte: u8,
buf: &'a mut Vec<u8, Global>
) -> ReadUntil<'a, Self> where
Self: Unpin,
[src]
&'a mut self,
byte: u8,
buf: &'a mut Vec<u8, Global>
) -> ReadUntil<'a, Self> where
Self: Unpin,
pub fn read_line(&'a mut self, buf: &'a mut String) -> ReadLine<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
pub fn lines(self) -> Lines<Self>
[src]
impl<R> AsyncReadExt for R where
R: AsyncRead + ?Sized,
R: AsyncRead + ?Sized,
pub fn read(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self> where
Self: Unpin,
Self: Unpin,
pub fn read_vectored(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self> where
Self: Unpin,
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self> where
Self: Unpin,
pub fn read_to_end(
&'a mut self,
buf: &'a mut Vec<u8, Global>
) -> ReadToEndFuture<'a, Self> where
Self: Unpin,
&'a mut self,
buf: &'a mut Vec<u8, Global>
) -> ReadToEndFuture<'a, Self> where
Self: Unpin,
pub fn read_to_string(
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self> where
Self: Unpin,
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self> where
Self: Unpin,
pub fn read_exact(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self> where
Self: Unpin,
Self: Unpin,
pub fn take(self, limit: u64) -> Take<Self>
pub fn bytes(self) -> Bytes<Self>
pub fn chain<R>(self, next: R) -> Chain<Self, R> where
R: AsyncRead,
R: AsyncRead,
pub fn boxed_reader<'a>(self) -> Pin<Box<dyn AsyncRead + 'a + Send, Global>> where
Self: Send + 'a,
Self: Send + 'a,
impl<R> AsyncReadExt for R where
R: AsyncRead + ?Sized,
[src]
R: AsyncRead + ?Sized,
pub fn chain<R>(self, next: R) -> Chain<Self, R> where
R: AsyncRead,
[src]
R: AsyncRead,
pub fn read(&'a mut self, buf: &'a mut [u8]) -> Read<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
pub fn read_vectored(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectored<'a, Self> where
Self: Unpin,
[src]
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectored<'a, Self> where
Self: Unpin,
pub fn read_exact(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
pub fn read_to_end(
&'a mut self,
buf: &'a mut Vec<u8, Global>
) -> ReadToEnd<'a, Self> where
Self: Unpin,
[src]
&'a mut self,
buf: &'a mut Vec<u8, Global>
) -> ReadToEnd<'a, Self> where
Self: Unpin,
pub fn read_to_string(
&'a mut self,
buf: &'a mut String
) -> ReadToString<'a, Self> where
Self: Unpin,
[src]
&'a mut self,
buf: &'a mut String
) -> ReadToString<'a, Self> where
Self: Unpin,
pub fn split(self) -> (ReadHalf<Self>, WriteHalf<Self>) where
Self: AsyncWrite,
[src]
Self: AsyncWrite,
pub fn take(self, limit: u64) -> Take<Self>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> BufReadExt for T where
T: AsyncBufRead + ?Sized,
[src]
T: AsyncBufRead + ?Sized,
pub fn read_until(
&'a mut self,
byte: u8,
buf: &'a mut Vec<u8, Global>
) -> ReadUntilFuture<'a, Self> where
Self: Unpin,
[src]
&'a mut self,
byte: u8,
buf: &'a mut Vec<u8, Global>
) -> ReadUntilFuture<'a, Self> where
Self: Unpin,
pub fn read_line(&'a mut self, buf: &'a mut String) -> ReadLineFuture<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
pub fn lines(self) -> Lines<Self> where
Self: Unpin,
[src]
Self: Unpin,
pub fn split(self, byte: u8) -> Split<Self>
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ReadExt for T where
T: AsyncRead + ?Sized,
[src]
T: AsyncRead + ?Sized,
pub fn read(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
pub fn read_vectored(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self> where
Self: Unpin,
[src]
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self> where
Self: Unpin,
pub fn read_to_end(
&'a mut self,
buf: &'a mut Vec<u8, Global>
) -> ReadToEndFuture<'a, Self> where
Self: Unpin,
[src]
&'a mut self,
buf: &'a mut Vec<u8, Global>
) -> ReadToEndFuture<'a, Self> where
Self: Unpin,
pub fn read_to_string(
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self> where
Self: Unpin,
[src]
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self> where
Self: Unpin,
pub fn read_exact(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
pub fn take(self, limit: u64) -> Take<Self>
[src]
pub fn by_ref(&mut self) -> &mut Self
[src]
pub fn bytes(self) -> Bytes<Self>
[src]
pub fn chain<R>(self, next: R) -> Chain<Self, R> where
R: AsyncRead,
[src]
R: AsyncRead,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,