Trait cfx_storage::utils::WrappedCreateFrom
source · 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.
Object Safety§
This trait is not object safe.