cosmic::prelude

Trait Also

Source
pub trait Also: Sized {
    // Provided method
    fn also<F>(self, block: F) -> Self
       where F: FnOnce(&mut Self) { ... }
}
Expand description

Represents a type that you can apply arbitrary functions to. Useful for when a method doesn’t return the receiver but you want to apply several of them to the object.

Provided Methods§

Source

fn also<F>(self, block: F) -> Self
where F: FnOnce(&mut Self),

Apply a function to this value and return the (possibly) modified value.

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