pub trait MapSelf {
// Provided methods
fn map_self<O, T>(self, op: O) -> T
where O: FnOnce(Self) -> T,
Self: Sized { ... }
fn map_self_or_keep<O>(self, op: O) -> Self
where O: FnOnce(&Self) -> Option<Self>,
Self: Sized { ... }
}
Expand description
Functions to transform a type itself instead of something it contains with the usual closure approach.