Skip to main content

future_local

Function future_local 

Source
pub fn future_local<T, E, Fut>(make: impl Fn() -> Fut + 'static) -> Operator<T>
where T: 'static, E: Error + 'static, Fut: Future<Output = Result<T, E>> + 'static,
Expand description

future_local: run a fresh single-thread local fallible future on activation.

Ok(value) emits DATA then COMPLETE; Err(error) emits ERROR. A plain Rust Future<Output = T> has no rejection channel, so Rust async sources use the fallible Result shape as the protocol error bridge.