HttpUpgrade

Trait HttpUpgrade 

Source
pub trait HttpUpgrade: Send {
    // Required method
    fn upgrade(
        &mut self,
        conn: &mut dyn HttpConnection,
    ) -> impl Future<Output = Result<()>> + Send;
}
Expand description

Http protocol upgrade

Allows to access underlying TCP socket with your handler

Use in HttpBody::Upgrade. Only applicable to HTTP/1.1

Required Methods§

Source

fn upgrade( &mut self, conn: &mut dyn HttpConnection, ) -> impl Future<Output = Result<()>> + Send

Handles the upgrade

Equivalent signature: async fn upgrade(&mut self, conn: &mut dyn HttpConnection) -> io::Result<()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§