[][src]Trait cursive::With

pub trait With {
    pub fn wrap_with<U, F>(self, f: F) -> U
    where
        F: FnOnce(Self) -> U
, { ... }
pub fn with<F>(self, f: F) -> Self
    where
        F: FnOnce(&mut Self)
, { ... }
pub fn try_with<E, F>(self, f: F) -> Result<Self, E>
    where
        F: FnOnce(&mut Self) -> Result<(), E>
, { ... }
pub fn with_if<F>(self, condition: bool, f: F) -> Self
    where
        F: FnOnce(&mut Self)
, { ... } }

Generic trait to enable chainable API

Provided methods

pub fn wrap_with<U, F>(self, f: F) -> U where
    F: FnOnce(Self) -> U, 
[src]

Calls the given closure and return the result.

Used to chainify wrapper constructors.

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

Calls the given closure on self.

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

Calls the given closure on self.

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

Calls the given closure if condition == true.

Loading content...

Implementors

impl<T> With for T[src]

Loading content...