Struct frappe::SignalNested
[−]
[src]
pub struct SignalNested<T>(_);
A signal that contains a signal, and allows sampling the inner signal directly.
This is produced by Signal::switch
Trait Implementations
impl<T: Clone> Clone for SignalNested<T>
[src]
fn clone(&self) -> SignalNested<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: Clone + 'static> Signal<T> for SignalNested<T>
[src]
fn sample(&self) -> T
Sample by value. Read more
fn sample_with<F, R>(&self, cb: F) -> R where
F: FnOnce(Cow<T>) -> R,
F: FnOnce(Cow<T>) -> R,
Sample by reference. Read more
fn map<F, R>(&self, f: F) -> SignalFn<R> where
F: Fn(Cow<T>) -> R + 'static,
R: Clone,
T: Clone + 'static,
F: Fn(Cow<T>) -> R + 'static,
R: Clone,
T: Clone + 'static,
Maps a signal with the provided function.
fn snapshot<S, F, R>(&self, trigger: &Stream<S>, f: F) -> Stream<R> where
F: Fn(Cow<T>, Cow<S>) -> R + 'static,
S: Clone + 'static,
R: Clone + 'static,
T: Clone + 'static,
F: Fn(Cow<T>, Cow<S>) -> R + 'static,
S: Clone + 'static,
R: Clone + 'static,
T: Clone + 'static,
Samples the value of this signal every time the trigger stream fires.
fn switch<U>(&self) -> SignalNested<U> where
T: Signal<U> + Into<SignalAny<U>>,
U: Clone,
T: Signal<U> + Into<SignalAny<U>>,
U: Clone,
Creates a new signal that samples the inner value of a nested signal.