With

Trait With 

Source
pub trait With {
    // Provided method
    fn with(self, f: impl FnOnce(Self) -> Self) -> Self
       where Self: Sized { ... }
}
Expand description

A trait for elements that can be modified.

Provided Methods§

Source

fn with(self, f: impl FnOnce(Self) -> Self) -> Self
where Self: Sized,

Applies the given closure to modify the element and return a new copy.

Implementors§