Struct pinned_aliasable::Aliasable [−][src]
pub struct Aliasable<T> { /* fields omitted */ }
Expand description
An unboxed aliasable value.
Implementations
Get a shared reference to the value inside the Aliasable
.
This method takes Pin
<&Self>
instead of &self
to enforce that all parent containers
are !
Unpin
, and thus won’t be annotated with noalias
.
This crate intentionally does not provide a method to get an &mut T
, because the value
may be shared. To obtain an &mut T
you should use an interior mutable container such as a
mutex or UnsafeCell
.
Get a shared reference to the value inside the Aliasable
with an extended lifetime.
Safety
The reference must not be held for longer than the Aliasable
exists.