moveit::new

Function by_raw

Source
pub unsafe fn by_raw<T, F>(f: F) -> impl New<Output = T>
where F: FnOnce(Pin<&mut MaybeUninit<T>>),
Expand description

Returns a New that uses the provided closure for construction.

This is the most primitive New-creation function, and is almost-always preferred over implementing New directly.

ยงSafety

f must respect the safety requirements of New, since it is used as an implementation basis.