Skip to main content

LegacyProxyHook

Trait LegacyProxyHook 

Source
pub trait LegacyProxyHook: Send + Sync {
    // Provided methods
    fn wants_control_mutation(&self) -> bool { ... }
    fn on_control_message(
        &self,
        _session_id: SessionId,
        _side: ProxySide,
        _message: &AnyControlMessage,
        _raw_bytes: &[u8],
    ) -> Option<Vec<u8>> { ... }
    fn on_datagram(
        &self,
        _session_id: SessionId,
        _side: ProxySide,
        _header: &AnyDatagramHeader,
        _raw_bytes: &[u8],
    ) -> Option<Vec<u8>> { ... }
}
๐Ÿ‘ŽDeprecated since 0.4.0:

implement ProxyHook directly; wrap in LegacyHook to migrate

Expand description

The 0.3.x hook shape, kept so existing implementations still compile.

Implement ProxyHook directly for new code; wrap an existing implementation in LegacyHook to migrate without rewriting it.

Provided Methodsยง

Source

fn wants_control_mutation(&self) -> bool

๐Ÿ‘ŽDeprecated since 0.4.0:

implement ProxyHook directly; wrap in LegacyHook to migrate

Whether this hook may rewrite control messages.

Source

fn on_control_message( &self, _session_id: SessionId, _side: ProxySide, _message: &AnyControlMessage, _raw_bytes: &[u8], ) -> Option<Vec<u8>>

๐Ÿ‘ŽDeprecated since 0.4.0:

implement ProxyHook directly; wrap in LegacyHook to migrate

Called before forwarding a control message.

Source

fn on_datagram( &self, _session_id: SessionId, _side: ProxySide, _header: &AnyDatagramHeader, _raw_bytes: &[u8], ) -> Option<Vec<u8>>

๐Ÿ‘ŽDeprecated since 0.4.0:

implement ProxyHook directly; wrap in LegacyHook to migrate

Called before forwarding a datagram.

Dyn Compatibilityยง

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementorsยง