Trait WithSelf

Source
pub trait WithSelf: Sized {
    // Provided method
    fn with_self<Void>(self, f: impl FnOnce(&mut Self) -> Void) -> Self { ... }
}

Provided Methods§

Source

fn with_self<Void>(self, f: impl FnOnce(&mut Self) -> Void) -> Self

Takes ownership of the value, passing a mutable reference of it to a closure, then returning ownership of the value again

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> WithSelf for T