[][src]Struct atomic_hooks::ReactiveStateAccess

pub struct ReactiveStateAccess<T, U, A> {
    pub id: StorageKey,
    pub _phantom_data_stored_type: PhantomData<T>,
    pub _phantom_data_undo: PhantomData<U>,
    pub _phantom_data_accessor_type: PhantomData<A>,
}

Accessor struct that provides access to getting and setting the state of the stored type

Fields

id: StorageKey_phantom_data_stored_type: PhantomData<T>_phantom_data_undo: PhantomData<U>_phantom_data_accessor_type: PhantomData<A>

Implementations

impl<T, U, A> ReactiveStateAccess<T, U, A> where
    T: 'static, 
[src]

pub fn new(id: StorageKey) -> ReactiveStateAccess<T, U, A>[src]

pub fn insert_set(self, value: T) where
    Self: OverloadedUpdateStateAccess<T>, 
[src]

pub fn set(self, value: T) where
    Self: OverloadedUpdateStateAccess<T>, 
[src]

pub fn remove(self) -> Option<T>[src]

pub fn delete(self)[src]

pub fn undo(&self) where
    Self: OverloadedUpdateStateAccess<T>, 
[src]

pub fn update<F: FnOnce(&mut T)>(&self, func: F) where
    Self: OverloadedUpdateStateAccess<T>, 
[src]

updates the stored state in place using the provided function

pub fn reset_to_default(&self) where
    Self: OverloadedUpdateStateAccess<T>, 
[src]

pub fn state_exists(self) -> bool[src]

pub fn get_with<F: FnOnce(&T) -> R, R>(&self, func: F) -> R[src]

pub fn on_update<F: FnOnce() -> R, R>(&self, func: F) -> Option<R>[src]

Trait Implementations

impl<T, U, A> Add<ReactiveStateAccess<T, U, A>> for ReactiveStateAccess<T, U, A> where
    T: Copy + Add<Output = T> + 'static, 
[src]

type Output = T

The resulting type after applying the + operator.

impl<T, U, A> ChangedAtomState for ReactiveStateAccess<T, U, A> where
    T: Clone + 'static + PartialEq
[src]

impl<T, U, A> Clone for ReactiveStateAccess<T, U, A>[src]

impl<T, U, A> CloneReactiveState<T> for ReactiveStateAccess<T, U, A> where
    T: Clone + 'static, 
[src]

fn get(&self) -> T[src]

returns a clone of the stored state panics if not stored.

impl<T, U, A> Copy for ReactiveStateAccess<T, U, A>[src]

impl<T, U, A> Debug for ReactiveStateAccess<T, U, A>[src]

impl<T, U, A> Display for ReactiveStateAccess<T, U, A> where
    T: Display + 'static, 
[src]

impl<T, U, A> Div<ReactiveStateAccess<T, U, A>> for ReactiveStateAccess<T, U, A> where
    T: Copy + Div<Output = T> + 'static, 
[src]

type Output = T

The resulting type after applying the / operator.

impl<T, U, A> Mul<ReactiveStateAccess<T, U, A>> for ReactiveStateAccess<T, U, A> where
    T: Copy + Mul<Output = T> + 'static, 
[src]

type Output = T

The resulting type after applying the * operator.

impl<T, U, A> Observable<T> for ReactiveStateAccess<T, U, A> where
    T: 'static, 
[src]

impl<T, U, A> ObservableVec<T, U, A> for ReactiveStateAccess<Vec<T>, U, A> where
    T: 'static, 
[src]

impl<T, U, A, UB, AB> ObservableVec<T, U, A> for ReactiveStateAccess<FilterVec<T, U, A>, UB, AB> where
    T: 'static, 
[src]

impl<T> OverloadedUpdateStateAccess<T> for ReactiveStateAccess<T, NoUndo, IsAnAtomState> where
    T: 'static, 
[src]

impl<T> OverloadedUpdateStateAccess<T> for ReactiveStateAccess<T, AllowUndo, IsAnAtomState> where
    T: Clone + 'static, 
[src]

impl<T, U, A> Sub<ReactiveStateAccess<T, U, A>> for ReactiveStateAccess<T, U, A> where
    T: Copy + Sub<Output = T> + 'static, 
[src]

type Output = T

The resulting type after applying the - operator.

Auto Trait Implementations

impl<T, U, A> RefUnwindSafe for ReactiveStateAccess<T, U, A> where
    A: RefUnwindSafe,
    T: RefUnwindSafe,
    U: RefUnwindSafe

impl<T, U, A> Send for ReactiveStateAccess<T, U, A> where
    A: Send,
    T: Send,
    U: Send

impl<T, U, A> Sync for ReactiveStateAccess<T, U, A> where
    A: Sync,
    T: Sync,
    U: Sync

impl<T, U, A> Unpin for ReactiveStateAccess<T, U, A> where
    A: Unpin,
    T: Unpin,
    U: Unpin

impl<T, U, A> UnwindSafe for ReactiveStateAccess<T, U, A> where
    A: UnwindSafe,
    T: UnwindSafe,
    U: UnwindSafe

Blanket Implementations

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

impl<T> Any for T where
    T: Any
[src]

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

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

impl<T> CloneAny for T where
    T: Clone + Any
[src]

impl<T> CloneAny for T where
    T: Clone + Any
[src]

impl<T> DebugAny for T where
    T: Any + Debug
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

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

impl<T> Slottable for T where
    T: Copy
[src]

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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> UnsafeAny for T where
    T: Any