Trait cursive_core::With
source · pub trait With: Sized {
// Provided methods
fn wrap_with<U, F: FnOnce(Self) -> U>(self, f: F) -> U { ... }
fn with<F: FnOnce(&mut Self)>(self, f: F) -> Self { ... }
fn try_with<E, F>(self, f: F) -> Result<Self, E>
where F: FnOnce(&mut Self) -> Result<(), E> { ... }
fn with_if<F>(self, condition: bool, f: F) -> Self
where F: FnOnce(&mut Self) { ... }
}Expand description
Generic trait to enable chainable API
Provided Methods§
sourcefn wrap_with<U, F: FnOnce(Self) -> U>(self, f: F) -> U
fn wrap_with<U, F: FnOnce(Self) -> U>(self, f: F) -> U
Calls the given closure and return the result.
Used to chainify wrapper constructors.
Object Safety§
This trait is not object safe.