Skip to main content

Run

Trait Run 

Source
pub trait Run<D = ()>: Seal {
    // Required method
    fn run<T: Default>(self, n: T)
       where Range<T>: Iterator;
}
Expand description

Run a function N times

Required Methods§

Source

fn run<T: Default>(self, n: T)
where Range<T>: Iterator,

Run it a certain number of times.

// twice.
(|| dbg!("ya")).run(2);

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<D, F: FnMut() -> D + Seal> Run<D> for F