Struct hooks::shared_ref::SharedRef
source · pub struct SharedRef<T>(_);Implementations§
Trait Implementations§
§type Value = &'hook SharedRef<T>
type Value = &'hook SharedRef<T>
The output type of
Hook::use_hook. Read morefn get(&self) -> Twhere T: Copy,
fn get_cloned(&self) -> Twhere T: Clone,
fn set(&self, new_value: T)
source§fn replace_mut<F: FnOnce(&mut T) -> T>(&self, f: F) -> T
fn replace_mut<F: FnOnce(&mut T) -> T>(&self, f: F) -> T
The old value is returned.
fn map<R>(&self, f: impl FnOnce(&T) -> R) -> R
fn map_mut<R>(&self, f: impl FnOnce(&mut T) -> R) -> R
source§fn replace_with<F: FnOnce(&T) -> T>(&self, f: F) -> T
fn replace_with<F: FnOnce(&T) -> T>(&self, f: F) -> T
The old value is returned.
Auto Trait Implementations§
Blanket Implementations§
source§fn use_hook(&mut self) -> Self::Valuewhere
Self: Unpin,
fn use_hook(&mut self) -> Self::Valuewhere Self: Unpin,
A shortcut to call
Hook::use_hook on Unpin hooks.fn next_value(&mut self) -> NextValue<'_, Self>where Self: Unpin,
fn into_values(self) -> Values<Self>where Self: Sized,
fn values(&mut self) -> Values<&mut Self>where Self: Unpin,
source§fn poll_next_update(&mut self, cx: &mut Context<'_>) -> Poll<bool>where
Self: Unpin,
fn poll_next_update(&mut self, cx: &mut Context<'_>) -> Poll<bool>where Self: Unpin,
A shortcut to call
HookPollNextUpdate::poll_next_update on Unpin hooks.source§fn next_update(&mut self) -> NextUpdate<'_, Self>where
Self: Unpin,
fn next_update(&mut self) -> NextUpdate<'_, Self>where Self: Unpin,
Get a future which polls
HookPollNextUpdate::poll_next_update.