Function with

Source
pub fn with<R, T>(receiver: &R, closure: impl FnOnce(&R) -> T) -> T
Expand description

Calls the specified closure with the given receiver and returns its result.