pub trait Repr: Copy {
// Required methods
fn into_object(self) -> Obj;
unsafe fn take(object: Obj) -> Self;
unsafe fn share(object: Obj) -> Self;
unsafe fn release(self);
unsafe fn retain(self) -> Self;
}Expand description
How Lean passes a value of a type: as an object, or as a scalar it keeps unboxed.
Required Methods§
Sourcefn into_object(self) -> Obj
fn into_object(self) -> Obj
The value as an object: the form it has as an element of an array, an argument of a closure or a field of a polymorphic type. The object takes over the reference.
Sourceunsafe fn take(object: Obj) -> Self
unsafe fn take(object: Obj) -> Self
The value out of an object that Repr::into_object made, whose reference is given
up.
§Safety
object holds a value of this representation and the caller owns a reference to it.
The value out of an object that stays with its owner: one more reference to an object, a copy of a scalar.
§Safety
object holds a value of this representation.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".