Struct hooks::shared_ref::SharedRef
source · pub struct SharedRef<T>(/* private fields */);Implementations§
Trait Implementations§
§type Value = &'hook SharedRef<T>
type Value = &'hook SharedRef<T>
The output type of
Hook::use_hook. Read moretype Value = T
fn try_unwrap(self) -> Result<Self::Value, Self>where
Self: Sized,
fn 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 equivalent_to(&self, other: &Self) -> bool
fn equivalent_to(&self, other: &Self) -> bool
Returns
true if self and other are sharing values from the same allocation.
In that case, self and other are equivalent to each other
because calling the same method on either of them leads to the same result.Auto Trait Implementations§
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
source§impl<H> HookExt for H
impl<H> HookExt for H
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§impl<H> HookPollNextUpdateExt for Hwhere
H: HookPollNextUpdate + ?Sized,
impl<H> HookPollNextUpdateExt for Hwhere
H: HookPollNextUpdate + ?Sized,
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.