Trait redstone::Times
[−]
[src]
pub trait Times where
Self: Sized, { fn times<F: FnMut(Self)>(&self, closure: F); }
Trait to add times() method to built-in types
Required Methods
fn times<F: FnMut(Self)>(&self, closure: F)
Execute closure N times
Examples
use redstone::Times; fn main() { 10.times(|i| { println!("Printing this {}th time", i); }); }