[−][src]Struct seed_hooks::StateAccess
Accessor struct that provides access to getting and setting the state of the stored type
Fields
id: TopoKey
Implementations
impl<T> StateAccess<T> where
T: 'static,
[src]
T: 'static,
pub fn new(id: TopoKey) -> StateAccess<T>
[src]
pub fn set(self, value: T)
[src]
pub fn remove(self) -> Option<T>
[src]
pub fn delete(self)
[src]
pub fn reset_on_unmount(self) -> StateAccess<T>
[src]
pub fn update<F>(self, func: F) where
F: FnOnce(&mut T),
[src]
F: FnOnce(&mut T),
updates the stored state in place using the provided function
pub fn state_exists(self) -> bool
[src]
pub fn get_with<F, R>(self, func: F) -> R where
F: FnOnce(&T) -> R,
[src]
F: FnOnce(&T) -> R,
Trait Implementations
impl<T> Add<StateAccess<T>> for StateAccess<T> where
T: Copy + Add<T, Output = T> + 'static,
[src]
T: Copy + Add<T, Output = T> + 'static,
type Output = T
The resulting type after applying the +
operator.
fn add(
self,
other: StateAccess<T>
) -> <StateAccess<T> as Add<StateAccess<T>>>::Output
[src]
self,
other: StateAccess<T>
) -> <StateAccess<T> as Add<StateAccess<T>>>::Output
impl<T> ChangedState for StateAccess<T> where
T: Clone + 'static + PartialEq<T>,
[src]
T: Clone + 'static + PartialEq<T>,
impl<T> Clone for StateAccess<T>
[src]
fn clone(&self) -> StateAccess<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> CloneState<T> for StateAccess<T> where
T: Clone + 'static,
[src]
T: Clone + 'static,
fn get(&self) -> T
[src]
returns a clone of the stored state panics if not stored.
fn soft_get(&self) -> Option<T>
[src]
impl<T> Copy for StateAccess<T>
[src]
impl<T> Debug for StateAccess<T>
[src]
impl<T> Display for StateAccess<T> where
T: Display + 'static,
[src]
T: Display + 'static,
impl<T> Div<StateAccess<T>> for StateAccess<T> where
T: Copy + Div<T, Output = T> + 'static,
[src]
T: Copy + Div<T, Output = T> + 'static,
type Output = T
The resulting type after applying the /
operator.
fn div(
self,
other: StateAccess<T>
) -> <StateAccess<T> as Div<StateAccess<T>>>::Output
[src]
self,
other: StateAccess<T>
) -> <StateAccess<T> as Div<StateAccess<T>>>::Output
impl<T> Mul<StateAccess<T>> for StateAccess<T> where
T: Copy + Mul<T, Output = T> + 'static,
[src]
T: Copy + Mul<T, Output = T> + 'static,
type Output = T
The resulting type after applying the *
operator.
fn mul(
self,
other: StateAccess<T>
) -> <StateAccess<T> as Mul<StateAccess<T>>>::Output
[src]
self,
other: StateAccess<T>
) -> <StateAccess<T> as Mul<StateAccess<T>>>::Output
impl<T> Observable<T> for StateAccess<T> where
T: 'static,
[src]
T: 'static,
fn observe(&self) -> T where
T: Clone,
[src]
T: Clone,
fn observe_with<F, R>(&self, func: F) -> R where
F: FnOnce(&T) -> R,
[src]
F: FnOnce(&T) -> R,
impl<T> StateAccessEventHandlers<T> for StateAccess<T> where
T: 'static,
[src]
T: 'static,
fn input_ev<F: FnOnce(&mut T, String) + 'static + Clone, Ms: 'static>(
&self,
event: Ev,
func: F
) -> EventHandler<Ms>
[src]
&self,
event: Ev,
func: F
) -> EventHandler<Ms>
fn mouse_ev<F: FnOnce(&mut T, MouseEvent) + 'static + Clone, Ms: 'static>(
&self,
event: Ev,
func: F
) -> EventHandler<Ms>
[src]
&self,
event: Ev,
func: F
) -> EventHandler<Ms>
fn on_click<F: FnOnce(&mut T) + 'static + Clone, Ms: 'static>(
&self,
func: F
) -> EventHandler<Ms>
[src]
&self,
func: F
) -> EventHandler<Ms>
fn on_input<F: FnOnce(&mut T, String) + 'static + Clone, Ms: 'static>(
&self,
func: F
) -> EventHandler<Ms>
[src]
&self,
func: F
) -> EventHandler<Ms>
impl StateAccessUnmount for StateAccess<Unmount>
[src]
impl<Ms, T> StateAccessUpdateEl<El<Ms>> for StateAccess<T> where
T: UpdateEl<Ms> + 'static + Clone,
[src]
T: UpdateEl<Ms> + 'static + Clone,
impl<T> Sub<StateAccess<T>> for StateAccess<T> where
T: Copy + Sub<T, Output = T> + 'static,
[src]
T: Copy + Sub<T, Output = T> + 'static,
type Output = T
The resulting type after applying the -
operator.
fn sub(
self,
other: StateAccess<T>
) -> <StateAccess<T> as Sub<StateAccess<T>>>::Output
[src]
self,
other: StateAccess<T>
) -> <StateAccess<T> as Sub<StateAccess<T>>>::Output
Auto Trait Implementations
impl<T> RefUnwindSafe for StateAccess<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for StateAccess<T> where
T: Send,
T: Send,
impl<T> Sync for StateAccess<T> where
T: Sync,
T: Sync,
impl<T> Unpin for StateAccess<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for StateAccess<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CloneAny for T where
T: Clone + Any,
T: Clone + Any,
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Sealed<T> for T where
T: ?Sized,
T: ?Sized,
impl<T> Slottable for T where
T: Copy,
[src]
T: Copy,
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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.
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>,
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,