pub struct SelfReference<'a, T, R>where
    for<'this> R: RefDef<'this>,
    for<'this> <R as RefDef<'this>>::Type: 'a,
{ /* private fields */ }
Expand description

A Self-Referential Helper.

Implementations

You will “never” able to hold object before its pinned. try initializing as empty static object. (using Option, NonNull or Empty enum field)

reset referenceial object using object. object is now pinned so initializing referential type is safe. This is also useful when you consumed your own reference. (like in AsyncIterator)

get pinned mutable referencial object that has self lifetime.

get pinned referencial object that has self lifetime.

get mutable referencial object that has self lifetime.

get referencial object that has self lifetime.

reset referenceial object using unpinned object. object is now pinned so initializing referential type is safe. This is also useful when you consumed your own reference. (like in AsyncIterator)

Trait Implementations

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