pub trait Slot<T>: Sized {
// Required methods
fn of(collection: T) -> Self;
fn inner(&self) -> &T;
fn inner_mut(&mut self) -> &mut T;
fn into_inner(self) -> T;
}Expand description
What holds a collection of type T in a Lean object: the collection itself, or an Arc
of it. An Arc is shared by a pointer, so that a collection kept in two places, or read
out of another collection, is not copied; one of two holders that changes it gets a copy
of its own first, which is what Lean does with a value it holds twice.
Required Methods§
fn of(collection: T) -> Self
fn inner(&self) -> &T
Sourcefn inner_mut(&mut self) -> &mut T
fn inner_mut(&mut self) -> &mut T
The collection for changing, which is this holder’s alone afterwards.
fn into_inner(self) -> T
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".