Skip to main content

EventFacadeHandler

Trait EventFacadeHandler 

Source
pub trait EventFacadeHandler {
    // Provided methods
    fn on_connect<'a>(
        &'a mut self,
        _session_id: u64,
        _addr: IpAddr,
        _port: u16,
        _client_guid: u64,
    ) -> ServerHookFuture<'a> { ... }
    fn on_disconnect<'a>(
        &'a mut self,
        _session_id: u64,
        _reason: PeerDisconnectReason,
    ) -> ServerHookFuture<'a> { ... }
    fn on_packet<'a>(
        &'a mut self,
        _session_id: u64,
        _payload: Bytes,
    ) -> ServerHookFuture<'a> { ... }
    fn on_ack<'a>(
        &'a mut self,
        _session_id: u64,
        _receipt_id: u64,
    ) -> ServerHookFuture<'a> { ... }
    fn on_metrics<'a>(
        &'a mut self,
        _shard_id: usize,
        _snapshot: TransportMetricsSnapshot,
        _dropped_non_critical_events: u64,
    ) -> ServerHookFuture<'a> { ... }
}
Expand description

Event-driven callback surface that mirrors RakLibInterface-style hooks.

This trait is intentionally event-driven and is fed from RaknetServerEvent. All methods are optional and default to no-op.

Provided Methods§

Source

fn on_connect<'a>( &'a mut self, _session_id: u64, _addr: IpAddr, _port: u16, _client_guid: u64, ) -> ServerHookFuture<'a>

Source

fn on_disconnect<'a>( &'a mut self, _session_id: u64, _reason: PeerDisconnectReason, ) -> ServerHookFuture<'a>

Source

fn on_packet<'a>( &'a mut self, _session_id: u64, _payload: Bytes, ) -> ServerHookFuture<'a>

Source

fn on_ack<'a>( &'a mut self, _session_id: u64, _receipt_id: u64, ) -> ServerHookFuture<'a>

Source

fn on_metrics<'a>( &'a mut self, _shard_id: usize, _snapshot: TransportMetricsSnapshot, _dropped_non_critical_events: u64, ) -> ServerHookFuture<'a>

Implementors§