Trait MessageRouter

Source
pub trait MessageRouter: Send + Sync {
    // Required method
    fn route_message(
        &self,
        message: &Message,
    ) -> WebSocketResult<Option<RoutedMessage>>;

    // Provided method
    fn get_subscription_key(
        &self,
        symbol: &str,
        sub_type: SubscriptionType,
    ) -> String { ... }
}
Expand description

Message router trait

Required Methods§

Source

fn route_message( &self, message: &Message, ) -> WebSocketResult<Option<RoutedMessage>>

Route a message to the appropriate subscription

Returns None if the message is not a subscription message (e.g., auth response, pong)

Provided Methods§

Source

fn get_subscription_key( &self, symbol: &str, sub_type: SubscriptionType, ) -> String

Get subscription key for a symbol and type

Implementors§