pub struct Upgrade(/* private fields */);Expand description
§A HTTP protocol upgrade
Implementations§
Source§impl Upgrade
impl Upgrade
Sourcepub fn request_headers(&self) -> &Headers
pub fn request_headers(&self) -> &Headers
Borrows the HTTP request headers
Sourcepub fn take_request_headers(&mut self) -> Headers
pub fn take_request_headers(&mut self) -> Headers
Take the HTTP request headers
Sourcepub fn state(&self) -> &TypeSet
pub fn state(&self) -> &TypeSet
Borrows the state accumulated on the Conn before negotiating the upgrade
Sourcepub fn take_state(&mut self) -> TypeSet
pub fn take_state(&mut self) -> TypeSet
Takes the TypeSet accumulated on the Conn before negotiating the upgrade
Sourcepub fn state_mut(&mut self) -> &mut TypeSet
pub fn state_mut(&mut self) -> &mut TypeSet
Mutably borrow the TypeSet accumulated on the Conn before negotiating the upgrade
Sourcepub fn transport_mut(&mut self) -> (&[u8], &mut dyn Transport)
pub fn transport_mut(&mut self) -> (&[u8], &mut dyn Transport)
Mutably borrow the underlying transport
This returns a tuple of (buffered bytes, transport) in order to make salient the requirement to handle any buffered bytes before using the transport directly.
Sourcepub fn into_transport(self) -> (Vec<u8>, Box<dyn Transport>)
pub fn into_transport(self) -> (Vec<u8>, Box<dyn Transport>)
Consumes self, returning the underlying transport
This returns a tuple of (buffered bytes, transport) in order to make salient the requirement to handle any buffered bytes before using the transport directly.
Sourcepub fn peer_ip(&self) -> Option<IpAddr>
pub fn peer_ip(&self) -> Option<IpAddr>
Returns a copy of the peer IP address of the connection, if available
Borrows the :authority HTTP/3 pseudo-header
Sourcepub fn http_version(&self) -> &Version
pub fn http_version(&self) -> &Version
Borrows the HTTP version
Sourcepub fn is_secure(&self) -> bool
pub fn is_secure(&self) -> bool
Returns a copy of whether this connection was deemed secure by the handler stack
Borrows the shared state TypeSet for this application
Sourcepub fn path(&self) -> &str
pub fn path(&self) -> &str
Returns the HTTP request path up to but excluding any query component
Sourcepub fn querystring(&self) -> &str
pub fn querystring(&self) -> &str
Retrieves the query component of the path
Sourcepub fn context(&self) -> Arc<HttpContext>
pub fn context(&self) -> Arc<HttpContext>
Retrieves a clone of the HttpContext for this upgrade
Sourcepub fn h3_connection(&self) -> Option<Arc<H3Connection>>
pub fn h3_connection(&self) -> Option<Arc<H3Connection>>
Returns a clone of the H3 connection, if any
Trait Implementations§
Source§impl AsyncRead for Upgradewhere
Self: Unpin,
impl AsyncRead for Upgradewhere
Self: Unpin,
Source§impl AsyncWrite for Upgradewhere
Self: Unpin,
impl AsyncWrite for Upgradewhere
Self: Unpin,
Source§fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize>>
fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize>>
buf into the object. Read moreSource§fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
Auto Trait Implementations§
impl Freeze for Upgrade
impl !RefUnwindSafe for Upgrade
impl Send for Upgrade
impl Sync for Upgrade
impl Unpin for Upgrade
impl UnsafeUnpin for Upgrade
impl !UnwindSafe for Upgrade
Blanket Implementations§
Source§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<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
Source§fn write<'a>(&'a mut self, buf: &'a [u8]) -> WriteFuture<'a, Self>where
Self: Unpin,
fn write<'a>(&'a mut self, buf: &'a [u8]) -> WriteFuture<'a, Self>where
Self: Unpin,
Source§fn write_vectored<'a>(
&'a mut self,
bufs: &'a [IoSlice<'a>],
) -> WriteVectoredFuture<'a, Self>where
Self: Unpin,
fn write_vectored<'a>(
&'a mut self,
bufs: &'a [IoSlice<'a>],
) -> WriteVectoredFuture<'a, Self>where
Self: Unpin,
Source§fn write_all<'a>(&'a mut self, buf: &'a [u8]) -> WriteAllFuture<'a, Self>where
Self: Unpin,
fn write_all<'a>(&'a mut self, buf: &'a [u8]) -> WriteAllFuture<'a, Self>where
Self: Unpin,
Source§fn flush(&mut self) -> FlushFuture<'_, Self>where
Self: Unpin,
fn flush(&mut self) -> FlushFuture<'_, Self>where
Self: Unpin,
Source§fn boxed_writer<'a>(self) -> Pin<Box<dyn AsyncWrite + Send + 'a>>
fn boxed_writer<'a>(self) -> Pin<Box<dyn AsyncWrite + Send + 'a>>
dyn AsyncWrite + Send + 'a. Read more