Skip to main content

StreamHandler

Type Alias StreamHandler 

Source
pub type StreamHandler = Arc<dyn Fn(Stream) -> BoxFuture<Result<(), String>> + Send + Sync>;
Expand description

Serves one streaming session. When it returns Ok and has not ended the stream, the stream is closed on both sides; an Err or a panic aborts it with code error and the error’s text, as macula aborts a stream whose handler failed. A handler still running when its stream ends is dropped.

Aliased Type§

pub struct StreamHandler { /* private fields */ }