Trait FromStream

pub trait FromStream<T> {
    // Required methods
    fn from_stream(stream: impl Stream<Item = T> + Send + 'static) -> Self;
    fn from_stream_unsync(stream: impl Stream<Item = T> + 'static) -> Self;
}
Expand description

Allows creating a signal from an async [Stream].

Required Methods§

fn from_stream(stream: impl Stream<Item = T> + Send + 'static) -> Self

Creates a signal that contains the latest value of the stream.

fn from_stream_unsync(stream: impl Stream<Item = T> + 'static) -> Self

Creates a signal that contains the latest value of the stream.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

§

impl<S, T> FromStream<T> for S
where S: From<ArcReadSignal<Option<T>>> + Send + Sync, T: Send + Sync + 'static,