pub unsafe trait ObjectRefCore: Sized + Clone {
type ContainerType: ObjectCore;
// Required methods
fn data(this: &Self) -> &ObjectArc<Self::ContainerType>;
fn into_data(this: Self) -> ObjectArc<Self::ContainerType>;
fn from_data(data: ObjectArc<Self::ContainerType>) -> Self;
}
Expand description
Traits to specify core operations of ObjectRef
used by the ffi Any system and not user facing
We mark as unsafe since it moves out the internal of the ObjectRef
Required Associated Types§
Required Methods§
fn data(this: &Self) -> &ObjectArc<Self::ContainerType>
fn into_data(this: Self) -> ObjectArc<Self::ContainerType>
fn from_data(data: ObjectArc<Self::ContainerType>) -> Self
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.