[][src]Trait cursive::With

pub trait With: Sized {
    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)
, { ... } }

Generic trait to enable chainable API

Provided methods

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

Calls the given closure on self.

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

Calls the given closure on self.

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

Calls the given closure if condition == true.

Loading content...

Implementors

impl<T: Sized> With for T[src]

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

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

fn with_if<F>(self, condition: bool, f: F) -> Self where
    F: FnOnce(&mut Self), 
[src]

Loading content...