iced_futures::stream

Function try_channel

Source
pub fn try_channel<T, E, F>(
    size: usize,
    f: impl FnOnce(Sender<T>) -> F,
) -> impl Stream<Item = Result<T, E>>
where F: Future<Output = Result<(), E>>,
Expand description

Creates a new [Stream] that produces the items sent from a Future that can fail to the [mpsc::Sender] provided to the closure.