Type Alias scoped_stream_sink::DynLocalSinkFn
source · pub type DynLocalSinkFn<'env, T, E> = Box<dyn for<'scope> FnMut(Pin<&'scope mut LocalSinkInner<'scope, 'env, T>>) -> DynLocalSinkFuture<'scope, E> + 'env>;
Expand description
Erased type for the local scope function.
It accepts a LocalSinkInner
reference and returns a future, capturing it’s parameter.
§Examples
let func: scoped_stream_sink::DynLocalSinkFn<usize, ()> = Box::new(|mut stream| Box::pin(async move {
while let Some(v) = stream.next().await {
println!("Value: {v}");
}
Ok(())
}));
Aliased Type§
struct DynLocalSinkFn<'env, T, E>(/* private fields */);