pub struct UseStorage {
pub key: &'static str,
pub value: Signal<String>,
pub kind: UseStorageKind,
}Expand description
Reactive state for one stored value.
The handle carries the key it watches, the current value, and the kind of storage it lives in.
The value is a Signal<String>: a render closure that reads it
re-renders when the value changes, and nothing else in the tree is
disturbed.
Fields§
§key: &'static strThe storage key this handle watches.
value: Signal<String>The current stored value.
kind: UseStorageKindWhich storage the value lives in.
Implementations§
Source§impl UseStorage
Inherent implementation of UseStorage.
impl UseStorage
Inherent implementation of UseStorage.
Source§impl UseStorage
impl UseStorage
pub fn get_key(&self) -> &'static str
pub fn get_mut_key(&mut self) -> &mut &'static str
pub fn set_key(&mut self, val: &'static str) -> &mut Self
pub fn get_value(&self) -> Signal<String>
pub fn get_mut_value(&mut self) -> &mut Signal<String>
pub fn get_kind(&self) -> UseStorageKind
pub fn get_mut_kind(&mut self) -> &mut UseStorageKind
pub fn set_kind(&mut self, val: UseStorageKind) -> &mut Self
Trait Implementations§
Source§impl Clone for UseStorage
impl Clone for UseStorage
Source§impl Debug for UseStorage
impl Debug for UseStorage
Auto Trait Implementations§
impl Freeze for UseStorage
impl RefUnwindSafe for UseStorage
impl Send for UseStorage
impl Sync for UseStorage
impl Unpin for UseStorage
impl UnsafeUnpin for UseStorage
impl UnwindSafe for UseStorage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more