[][src]Struct epoxy_streams::WriteableReactiveValue

pub struct WriteableReactiveValue<T> { /* fields omitted */ }

Reactive value that is explicitly set, rather than being derived from a stream.

Examples

use epoxy_streams::ReactiveValue;

let writeable_value = ReactiveValue::new(5);
assert_eq!(*writeable_value.get(), 5);

writeable_value.set(50);
assert_eq!(*writeable_value.get(), 50);

Methods

impl<T: 'static> WriteableReactiveValue<T>[src]

pub fn set(&self, value: T)[src]

Sets the value of the ReactiveValue, using a mutex to ensure thread safety.

Note: use set_rc if your new value is already an Arc, as this will prevent the value from being unnecessarily copied.

pub fn set_rc(&self, value: Arc<T>)[src]

Sets the value of the ReactiveValue, using a mutex to ensure thread safety.

pub fn as_readonly(&self) -> ReadonlyReactiveValue<T>[src]

Returns a ReadonlyReactiveValue whose value matches this one. This is helpful when exposing ReactiveValues to public APIs, so that the consumer cannot alter the state of your component.

Trait Implementations

impl<T> ReactiveValue<T> for WriteableReactiveValue<T>[src]

impl<T> Clone for WriteableReactiveValue<T>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]