Skip to main content

FromStream

Trait FromStream 

Source
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§

Source

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

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

Source

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§

Source§

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