With

Trait With 

Source
pub trait With<T> {
    // Required method
    fn with<R>(&self, f: impl FnOnce(&T) -> R) -> R;
}
Expand description

Trait to apply a function to a reference.

Required Methods§

Source

fn with<R>(&self, f: impl FnOnce(&T) -> R) -> R

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T, BD: BorrowDeref<T>> With<T> for BD