Struct frappe::SignalShared
[−]
[src]
pub struct SignalShared<T>(_, _);
A signal that reads from shared data.
This is produced by stream methods that create a signal. It also contains a reference to it's parent stream to avoid it's deletion.
Methods
impl<T> SignalShared<T>
[src]
fn into_inner(self) -> Arc<RwLock<T>>
Returns the internal shared value.
The returned value can be moved across threads and converted back into a SignalShared
.
This also drops the reference to it's parent signal, so it can delete the signal
chain as a side effect.
Trait Implementations
impl<T: Debug> Debug for SignalShared<T>
[src]
impl<T: Clone> Clone for SignalShared<T>
[src]
fn clone(&self) -> SignalShared<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 SignalShared<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.