Struct trillium_http::Upgrade [−][src]
pub struct Upgrade<Transport> { pub request_headers: Headers, pub path: String, pub method: Method, pub state: Extensions, pub transport: Transport, pub buffer: Option<Vec<u8>>, pub stopper: Stopper, }
Expand description
This open (pub fields) struct represents a http upgrade. It contains all of the data available on a Conn, as well as owning the underlying transport.
Important implementation note: When reading directly from the
transport, ensure that you read from buffer
first if there are bytes
in it. Alternatively, read directly from the Upgrade, as that
AsyncRead implementation will drain the buffer first before reading
from the transport.
Fields
request_headers: Headers
The http request headers
path: String
The request path
method: Method
The http request method
state: Extensions
Any state that has been accumulated on the Conn before negotiating the upgrade
transport: Transport
The underlying io (often a TcpStream or similar)
buffer: Option<Vec<u8>>
Any bytes that have been read from the underlying tcpstream already. It is your responsibility to process these bytes before reading directly from the transport.
stopper: Stopper
A Stopper
which can and should be used to gracefully shut
down any long running streams or futures associated with this
upgrade
Implementations
any state that has been accumulated on the Conn before negotiating the upgrade.
Trait Implementations
Attempt to read from the AsyncRead
into buf
. Read more
Auto Trait Implementations
impl<Transport> !RefUnwindSafe for Upgrade<Transport>
impl<Transport> !UnwindSafe for Upgrade<Transport>
Blanket Implementations
Reads some bytes from the byte stream. Read more
fn read_vectored(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self> where
Self: Unpin,
fn read_vectored(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self> where
Self: Unpin,
fn read_to_end(
&'a mut self,
buf: &'a mut Vec<u8, Global>
) -> ReadToEndFuture<'a, Self> where
Self: Unpin,
fn read_to_end(
&'a mut self,
buf: &'a mut Vec<u8, Global>
) -> ReadToEndFuture<'a, Self> where
Self: Unpin,
fn read_to_string(
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self> where
Self: Unpin,
fn read_to_string(
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self> where
Self: Unpin,
Reads the exact number of bytes required to fill buf
. Read more
Creates an adapter which will read at most limit
bytes from it. Read more
Creates an adapter which will chain this stream with another. Read more
Writes some bytes into the byte stream. Read more
fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectoredFuture<'a, Self> where
Self: Unpin,
fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectoredFuture<'a, Self> where
Self: Unpin,
Writes an entire buffer into the byte stream. Read more
Flushes the stream to ensure that all buffered contents reach their destination. Read more
Closes the writer. Read more
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V