pub trait ConnectionAcceptor: Send + 'static {
// Required method
fn accept(
&self,
conn_id: ConnectionId,
peer_settings: &ConnectionSettings,
metadata: &[MetadataEntry<'_>],
) -> Result<AcceptedConnection, Metadata<'static>>;
}Expand description
Callback for accepting or rejecting inbound virtual connections.
Registered on the session via the builder’s .on_connection() method.
Called synchronously from the session run loop when a peer sends
ConnectionOpen. The acceptor returns either an AcceptedConnection
(with settings, metadata, and a setup callback that spawns the driver)
or rejection metadata.