pub trait StreamHandler {
    // Required method
    fn handle<'a>(
        &'a self,
        req: MessageData,
        streamer: RawStreamer,
        data: &'a Data
    ) -> PinnedFuture<'a, Result<MessageData, UnrecoverableError>> ;

    // Provided method
    fn validate_data(&self, _data: &Data) { ... }
}
Available on crate feature feature only.

Required Methods§

source

fn handle<'a>( &'a self, req: MessageData, streamer: RawStreamer, data: &'a Data ) -> PinnedFuture<'a, Result<MessageData, UnrecoverableError>>

every MessageData needs to correspond with the StreamTrait

§Warning

Your not allowed to drop streamer before you return from the function else that may leed to a busy loop in the StreamServer (todo improve that)

Provided Methods§

source

fn validate_data(&self, _data: &Data)

Implementors§