pub trait TakeFrom<T: ?Sized> {
const COPY_OPTIMIZATION: CopyOptimization<Self> = _;
// Required method
fn take_from(from: &T) -> Self;
}
Expand description
From
conversions which may take from a reference using interior mutability.
Provided Associated Constants§
Sourceconst COPY_OPTIMIZATION: CopyOptimization<Self> = _
const COPY_OPTIMIZATION: CopyOptimization<Self> = _
An optimization flag that allows the bytes of this type to be copied directly during
conversion instead of calling take_from
.
This optimization is disabled by default. To enable this optimization, you must unsafely
attest that Self
is trivially copyable using CopyOptimization::enable
or
CopyOptimization::enable_if
.
Required Methods§
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.