Skip to main content

FrameInspector

Trait FrameInspector 

Source
pub trait FrameInspector: Send + Sync {
    // Required methods
    fn inspect_client_frame<'life0, 'life1, 'async_trait>(
        &'life0 self,
        frame: &'life1 WebSocketFrame,
    ) -> Pin<Box<dyn Future<Output = InspectionResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn inspect_server_frame<'life0, 'life1, 'async_trait>(
        &'life0 self,
        frame: &'life1 WebSocketFrame,
    ) -> Pin<Box<dyn Future<Output = InspectionResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn correlation_id(&self) -> &str;
}
Expand description

Trait for WebSocket frame inspection.

This trait abstracts the frame inspection logic, allowing for easy testing with mock implementations.

Required Methods§

Source

fn inspect_client_frame<'life0, 'life1, 'async_trait>( &'life0 self, frame: &'life1 WebSocketFrame, ) -> Pin<Box<dyn Future<Output = InspectionResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Inspect a frame from client to server

Source

fn inspect_server_frame<'life0, 'life1, 'async_trait>( &'life0 self, frame: &'life1 WebSocketFrame, ) -> Pin<Box<dyn Future<Output = InspectionResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Inspect a frame from server to client

Source

fn correlation_id(&self) -> &str

Get the correlation ID for logging

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl FrameInspector for WebSocketInspector

Implementation of FrameInspector that delegates to WebSocketInspector