pub struct VRcMapped<VTable: VTableMetaDropInPlace + 'static, MappedType: ?Sized> { /* private fields */ }
Expand description

VRcMapped allows bundling a VRc of a type along with a reference to an object that’s reachable through the data the VRc owns and that satisfies the requirements of a Pin. VRCMapped is constructed using VRc::map and, like VRc, has a weak counterpart, VWeakMapped.

Implementations

Returns a new VWeakMapped that points to this instance and can be upgraded back to a Self as long as a VRc/VMapped exists.

Create a Pinned reference to the mapped type.

This is safe because the map function returns a pinned reference.

This function allows safely holding a reference to a field inside the VRcMapped. In order to accomplish that, you need to provide a mapping function map_fn in which you need to provide and return a pinned reference to the object you would like to map. The returned VRcMapped allows obtaining that pinned reference again using VRcMapped::as_pin_ref.

See also VRc::map

Returns a strong reference to the object that the mapping originates from.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

The resulting type after dereferencing.

Dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.