Struct dioxus_hooks::UseSharedState
source · [−]pub struct UseSharedState<'a, T: 'static> { /* private fields */ }Implementations
sourceimpl<'a, T: 'static> UseSharedState<'a, T>
impl<'a, T: 'static> UseSharedState<'a, T>
pub fn read(&self) -> Ref<'_, T>
pub fn notify_consumers(self)
pub fn read_write(&self) -> (Ref<'_, T>, &Self)
sourcepub fn write(&self) -> RefMut<'_, T>
pub fn write(&self) -> RefMut<'_, T>
Calling “write” will force the component to re-render
TODO: We prevent unncessary notifications only in the hook, but we should figure out some more global lock
sourcepub fn write_silent(&self) -> RefMut<'_, T>
pub fn write_silent(&self) -> RefMut<'_, T>
Allows the ability to write the value without forcing a re-render
pub fn inner(&self) -> Rc<RefCell<ProvidedStateInner<T>>>
Trait Implementations
sourceimpl<'a, T> Clone for UseSharedState<'a, T> where
T: 'static,
impl<'a, T> Clone for UseSharedState<'a, T> where
T: 'static,
impl<T> Copy for UseSharedState<'_, T>
Auto Trait Implementations
impl<'a, T> !RefUnwindSafe for UseSharedState<'a, T>
impl<'a, T> !Send for UseSharedState<'a, T>
impl<'a, T> !Sync for UseSharedState<'a, T>
impl<'a, T> Unpin for UseSharedState<'a, T>
impl<'a, T> !UnwindSafe for UseSharedState<'a, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more