Struct qcell::QCellOwnerID

source ·
pub struct QCellOwnerID(_);
Expand description

Internal ID associated with a QCell owner.

The only purpose of this is to create QCell instances without requiring a borrow on the owner. A QCellOwnerID can be passed to any code that needs to create QCell instances. However to access those QCell instances after creation will still require a borrow on the original owner. Create a QCellOwnerID from an owner using owner.into() or owner.id().

Safety

Whilst the existence of this type does mean that an ID can exist longer than than the owner, all that allows is new QCell instances to be created after the owner has gone. But QCell instances can outlive the owner in any case, so this makes no difference to safety.

Implementations§

source§

impl QCellOwnerID

source

pub fn cell<T>(self, value: T) -> QCell<T>

Create a new cell owned by this owner-ID. See also QCell::new.

Trait Implementations§

source§

impl Clone for QCellOwnerID

source§

fn clone(&self) -> QCellOwnerID

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 From<&QCellOwner> for QCellOwnerID

source§

fn from(owner: &QCellOwner) -> Self

Converts to this type from the input type.
source§

impl From<&QCellOwnerSeq> for QCellOwnerID

source§

fn from(owner: &QCellOwnerSeq) -> Self

Converts to this type from the input type.
source§

impl From<Pin<&QCellOwnerPinned>> for QCellOwnerID

source§

fn from(owner: Pin<&QCellOwnerPinned>) -> Self

Converts to this type from the input type.
source§

impl Hash for QCellOwnerID

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq<QCellOwnerID> for QCellOwnerID

source§

fn eq(&self, other: &QCellOwnerID) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for QCellOwnerID

source§

impl Eq for QCellOwnerID

source§

impl StructuralEq for QCellOwnerID

source§

impl StructuralPartialEq for QCellOwnerID

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.