pub trait WrappedCreateFrom<FromType, ToType> {
// Required method
fn take(x: FromType) -> ToType;
// Provided method
fn take_from(dest: &mut ToType, x: FromType) { ... }
}
Expand description
The purpose of this trait is to create a new value of a passed object, when the passed object is the value, simply move the value; when the passed object is the reference, create the new value by clone. Other extension is possible.
The trait is used by ChildrenTable and slab.
Required Methods§
Provided Methods§
Sourcefn take_from(dest: &mut ToType, x: FromType)
fn take_from(dest: &mut ToType, x: FromType)
Unoptimized default implementation.
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.