Trait With

Source
pub trait With: Sized {
    // Provided methods
    fn with<F>(self, f: F) -> Self
       where F: FnOnce(&mut Self) { ... }
    fn try_with<F, E>(self, f: F) -> Result<Self, E>
       where F: FnOnce(&mut Self) -> Result<(), E> { ... }
}

Provided Methods§

Source

fn with<F>(self, f: F) -> Self
where F: FnOnce(&mut Self),

Source

fn try_with<F, E>(self, f: F) -> Result<Self, E>
where F: FnOnce(&mut Self) -> Result<(), E>,

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: Sized> With for T