moveit::new

Function by

Source
pub fn by<T, F>(f: F) -> impl New<Output = T>
where F: FnOnce() -> T,
Expand description

Returns a New that uses the provided closure for constructing a T.

moveit! {
  let x = new::by(|| 21 * 2);
}
assert_eq!(*x, 42);