Trait fire_http_api::stream::server::StreamHandler
source · [−]pub trait StreamHandler<D> {
fn action(&self) -> &'static str;
fn kind(&self) -> StreamKind;
fn handle<'a>(
&'a self,
req: MessageData,
streamer: RawStreamer,
data: &'a D
) -> PinnedFuture<'a, Result<MessageData, UnrecoverableError>>ⓘNotable traits for PinnedFuture<'_, O>impl<O> Future for PinnedFuture<'_, O> type Output = O;;
}Required Methods
fn kind(&self) -> StreamKind
fn kind(&self) -> StreamKind
get’s only called once on insertion
fn handle<'a>(
&'a self,
req: MessageData,
streamer: RawStreamer,
data: &'a D
) -> PinnedFuture<'a, Result<MessageData, UnrecoverableError>>ⓘNotable traits for PinnedFuture<'_, O>impl<O> Future for PinnedFuture<'_, O> type Output = O;
fn handle<'a>(
&'a self,
req: MessageData,
streamer: RawStreamer,
data: &'a D
) -> PinnedFuture<'a, Result<MessageData, UnrecoverableError>>ⓘNotable traits for PinnedFuture<'_, O>impl<O> Future for PinnedFuture<'_, O> type Output = O;
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)