apply

Trait Also

source
pub trait Also: Sized {
    // Provided method
    fn also<F: FnOnce(&mut Self)>(self, block: F) -> 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: FnOnce(&mut Self)>(self, block: F) -> Self

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

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T: Sized> Also for T