Trait StreamHandler

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

    // Provided method
    fn validate_requirements(
        &self,
        _params: &ParamsNames<'_>,
        _resources: &Resources,
    ) { ... }
}
Available on crate feature feature only.

Required Methods§

Source

fn handle<'a>( &'a self, req: MessageData, header: &'a RequestHeader, params: &'a PathParams, streamer: RawStreamer, data: &'a Resources, ) -> 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_requirements( &self, _params: &ParamsNames<'_>, _resources: &Resources, )

Implementors§