Struct GenRefOwner

Source
pub struct GenRefOwner<T: 'static>(/* private fields */);

Implementations§

Source§

impl<T: 'static> GenRefOwner<T>

Source

pub fn new(initial_value: T) -> Self

Source

pub fn key(&self) -> GenRefKey<T>

The opposite of GenRefKey::upgrade.

Trait Implementations§

Source§

impl<T: 'static> Clone for GenRefOwner<T>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: 'static> Hook for GenRefOwner<T>

Source§

fn use_hook(self: Pin<&mut Self>) -> <Self as HookValue<'_>>::Value

Source§

impl<T: 'static> HookPollNextUpdate for GenRefOwner<T>

Source§

fn poll_next_update(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<bool>

The meaning of the return value is: Read more
Source§

impl<T: 'static> HookUnmount for GenRefOwner<T>

Source§

fn unmount(self: Pin<&mut Self>)

Source§

impl<'hook, T: 'static> HookValue<'hook> for GenRefOwner<T>

Source§

type Value = GenRefKey<T>

The output type of Hook::use_hook. Read more
Source§

impl<T: 'static> ShareValue for GenRefOwner<T>

Source§

type Value = T

Source§

fn map<R>(&self, f: impl FnOnce(&Self::Value) -> R) -> R

Source§

fn map_mut<R>(&self, f: impl FnOnce(&mut Self::Value) -> R) -> R

Source§

fn get(&self) -> Self::Value
where Self::Value: Copy,

Source§

fn get_cloned(&self) -> Self::Value
where Self::Value: Clone,

Source§

fn replace_mut<F: FnOnce(&mut Self::Value) -> Self::Value>( &self, f: F, ) -> Self::Value

The old value is returned.
Source§

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.
Source§

fn set(&self, new_value: Self::Value)

Source§

fn replace(&self, new_value: Self::Value) -> Self::Value

The old value is returned.
Source§

fn replace_with<F: FnOnce(&Self::Value) -> Self::Value>( &self, f: F, ) -> Self::Value

The old value is returned.
Source§

fn try_unwrap(self) -> Result<Self::Value, Self>

Source§

fn unwrap_or_get_cloned(self) -> Self::Value
where Self: Sized, Self::Value: Clone,

Source§

impl<T: 'static> ToOwnedShareValue for GenRefOwner<T>

Source§

impl<T: 'static> Unpin for GenRefOwner<T>

Auto Trait Implementations§

§

impl<T> Freeze for GenRefOwner<T>

§

impl<T> !RefUnwindSafe for GenRefOwner<T>

§

impl<T> !Send for GenRefOwner<T>

§

impl<T> !Sync for GenRefOwner<T>

§

impl<T> !UnwindSafe for GenRefOwner<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<H> HookExt for H
where H: Hook + ?Sized,

Source§

fn use_hook(&mut self) -> Self::Value
where Self: Unpin,

A shortcut to call Hook::use_hook on Unpin hooks.
Source§

fn next_value(&mut self) -> NextValue<'_, Self>
where Self: Unpin,

Source§

fn into_values(self) -> Values<Self>
where Self: Sized,

Source§

fn values(&mut self) -> Values<&mut Self>
where Self: Unpin,

Source§

impl<H> HookPollNextUpdateExt for H

Source§

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,

Get a future which polls HookPollNextUpdate::poll_next_update.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<H> IntoHook for H
where H: Hook,

Source§

type Hook = H

Source§

fn into_hook(self) -> <H as IntoHook>::Hook

Source§

fn into_hook_values(self) -> Values<Self::Hook>
where Self: Sized,

Source§

impl<H, V> NonLendingHook for H
where H: Hook<Value = V> + for<'hook> HookValue<'hook>,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U> Captures<U> for T
where T: ?Sized,