Struct frappe::SignalConst
[−]
[src]
pub struct SignalConst<T>(pub T);
A signal with constant value.
Trait Implementations
impl<T: Debug> Debug for SignalConst<T>
[src]
impl<T: Clone> Clone for SignalConst<T>
[src]
fn clone(&self) -> SignalConst<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 SignalConst<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.
impl<T> From<T> for SignalConst<T>
[src]
fn from(val: T) -> Self
Performs the conversion.