pub trait Upgrader<C>: UpgradeInfo + Clone {
type Output: Send;
// Required methods
fn upgrade_inbound<'async_trait>(
self,
socket: C,
info: <Self as UpgradeInfo>::Info,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + Send + 'async_trait>>
where Self: 'async_trait;
fn upgrade_outbound<'async_trait>(
self,
socket: C,
info: <Self as UpgradeInfo>::Info,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + Send + 'async_trait>>
where Self: 'async_trait;
}Expand description
Common trait for upgrades that can be applied on a connection.
Required Associated Types§
Required Methods§
Sourcefn upgrade_inbound<'async_trait>(
self,
socket: C,
info: <Self as UpgradeInfo>::Info,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
fn upgrade_inbound<'async_trait>(
self,
socket: C,
info: <Self as UpgradeInfo>::Info,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
After we have determined that the remote supports one of the protocols we support, this method is called to start the handshake.
The info is the identifier of the protocol, as produced by protocol_info.
Sourcefn upgrade_outbound<'async_trait>(
self,
socket: C,
info: <Self as UpgradeInfo>::Info,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
fn upgrade_outbound<'async_trait>(
self,
socket: C,
info: <Self as UpgradeInfo>::Info,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
After we have determined that the remote supports one of the protocols we support, this method is called to start the handshake.
The info is the identifier of the protocol, as produced by protocol_info.
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.