Skip to main content

ChannelReceiver

Trait ChannelReceiver 

Source
pub trait ChannelReceiver<C: ChannelKind>:
    Send
    + Sync
    + 'static {
    // Required method
    fn on_frame(&self, frame: Frame<C>);

    // Provided method
    fn on_replay_complete(
        &self,
        _channel: C,
        _from_cursor: u64,
        _to_cursor: u64,
    ) { ... }
}
Expand description

Handler for inbound frames on a specific channel.

Implement this trait to receive and process frames for a given channel. Register with PushClient::on before connecting.

Required Methods§

Source

fn on_frame(&self, frame: Frame<C>)

Called when a frame arrives on the registered channel.

Provided Methods§

Source

fn on_replay_complete(&self, _channel: C, _from_cursor: u64, _to_cursor: u64)

Called when the channel’s replay buffer catches up after reconnect. Default implementation does nothing.

Implementors§

Source§

impl<C, F> ChannelReceiver<C> for F
where C: ChannelKind, F: Fn(Frame<C>) + Send + Sync + 'static,

Blanket implementation for closures.