Struct maple_core::reactive::StateHandle [−][src]
A readonly Signal
.
Returned by functions that provide a handle to access state.
Use Signal::handle
or Signal::into_handle
to retrieve a handle from a Signal
.
Implementations
impl<T: 'static> StateHandle<T>
[src]
pub fn get(&self) -> Rc<T>
[src]
Get the current value of the state.
pub fn get_untracked(&self) -> Rc<T>
[src]
Get the current value of the state, without tracking this as a dependency if inside a reactive context.
Example
use maple_core::prelude::*; let state = Signal::new(1); let double = create_memo({ let state = state.clone(); move || *state.get_untracked() * 2 }); assert_eq!(*double.get(), 2); state.set(2); // double value should still be old value because state was untracked assert_eq!(*double.get(), 2);
Trait Implementations
impl<T: 'static> Clone for StateHandle<T>
[src]
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug> Debug for StateHandle<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for StateHandle<T>
impl<T> !Send for StateHandle<T>
impl<T> !Sync for StateHandle<T>
impl<T> Unpin for StateHandle<T>
impl<T> !UnwindSafe for StateHandle<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,