pub trait PoolDefault: Default {
// Required method
unsafe fn default_uninit(target: &mut MaybeUninit<Self>);
}
Expand description
A trait for initialising a MaybeUninit<Self>
to a default value.
Required Methods§
Sourceunsafe fn default_uninit(target: &mut MaybeUninit<Self>)
unsafe fn default_uninit(target: &mut MaybeUninit<Self>)
Initialise an instance of Self
to its default state.
Specifically, after calling self.default_uninit()
, the object’s state
should be equal to what <Self as Default>::default()
would produce.
§Safety
You should assume that the object as passed to you contains
uninitialised memory, and you must leave it in a fully initialised
state, as expected by MaybeUninit::assume_init()
.
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.