[−][src]Struct epoxy_streams::WriteableReactiveValue
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]
Auto Trait Implementations
impl<T> !Send for WriteableReactiveValue<T>
impl<T> !Sync for WriteableReactiveValue<T>
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,