[][src]Trait libsugar::side_effect::Used

pub trait Used: Sized {
    pub fn used<F: FnOnce(Self) -> R, R>(self, f: F) -> R;
}

Create an implicit variable, and make a mapping for it

Example

let v = 1.used(|v| { v + 1 });
assert_eq!(v, 2);

Required methods

pub fn used<F: FnOnce(Self) -> R, R>(self, f: F) -> R[src]

Create an implicit variable, and make a mapping for it

Example

let v = 1.used(|v| { v + 1 });
assert_eq!(v, 2);
Loading content...

Implementors

impl<T> Used for T[src]

Loading content...