pub trait ConnectionHook<Io>:
Send
+ Sync
+ 'static{
type Error: StdError + Send + Sync + 'static;
// Required method
fn on_connection(
&self,
io: Io,
) -> impl Future<Output = HookResult<Io, Self::Error>> + Send;
}Expand description
Connection hook executed during connection establishment.
For server sockets: called when a connection is accepted. For client sockets: called after connecting.
The connection hook receives the raw IO stream and has full control over the handshake protocol.
Required Associated Types§
Required Methods§
Sourcefn on_connection(
&self,
io: Io,
) -> impl Future<Output = HookResult<Io, Self::Error>> + Send
fn on_connection( &self, io: Io, ) -> impl Future<Output = HookResult<Io, Self::Error>> + Send
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.