Function through::through_and

source ·
pub fn through_and<T, O>(elem: &mut T, func: impl FnOnce(T) -> (T, O)) -> O
Expand description

Mutate a referenced element by transferring ownership through a function, which also produces an output datum which is returned from this function.