Function try_with

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

Calls the specified closure with the given receiver and returns a Result.