[][src]Struct abstutil::time::Timer

pub struct Timer<'a> {
    results: Vec<String>,
    stack: Vec<StackEntry>,
    outermost_name: String,
    notes: Vec<String>,
    pub(crate) warnings: Vec<String>,
    pub(crate) errors: Vec<String>,
    sink: Option<Box<dyn TimerSink + 'a>>,
}

Hierarchial magic

Fields

results: Vec<String>stack: Vec<StackEntry>outermost_name: Stringnotes: Vec<String>warnings: Vec<String>errors: Vec<String>sink: Option<Box<dyn TimerSink + 'a>>

Implementations

impl<'a> Timer<'a>[src]

pub fn new<S: Into<String>>(raw_name: S) -> Timer<'a>

Notable traits for Timer<'a>

impl<'a> Read for Timer<'a>
[src]

pub fn new_with_sink(name: &str, sink: Box<dyn TimerSink + 'a>) -> Timer<'a>

Notable traits for Timer<'a>

impl<'a> Read for Timer<'a>
[src]

pub fn throwaway() -> Timer<'a>

Notable traits for Timer<'a>

impl<'a> Read for Timer<'a>
[src]

fn println(&mut self, line: String)[src]

fn selfless_println(
    maybe_sink: &mut Option<Box<dyn TimerSink + 'a>>,
    line: String
)
[src]

pub fn note(&mut self, line: String)[src]

Log immediately, but also repeat at the end, to avoid having to scroll up and find interesting debug stuff.

pub fn warn(&mut self, line: String)[src]

pub fn error(&mut self, line: String)[src]

pub fn done(self)[src]

Used to end the scope of a timer early.

pub fn start<S: Into<String>>(&mut self, raw_name: S)[src]

pub fn stop<S: Into<String>>(&mut self, raw_name: S)[src]

pub fn start_iter<S: Into<String>>(&mut self, raw_name: S, total_items: usize)[src]

pub fn next(&mut self)[src]

pub fn cancel_iter_early(&mut self)[src]

pub fn add_result(&mut self, elapsed: f64, line: String)[src]

pub fn parallelize<I, O, F: Fn(I) -> O>(
    &mut self,
    timer_name: &str,
    parallelism: Parallelism,
    requests: Vec<I>,
    cb: F
) -> Vec<O> where
    I: Send,
    O: Send,
    F: Send + Clone + Copy
[src]

The order of the result is deterministic / matches the input.

pub fn read_file(&mut self, path: &str) -> Result<(), String>[src]

Then the caller passes this in as a reader

Trait Implementations

impl<'a> Drop for Timer<'a>[src]

impl<'a> Read for Timer<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Timer<'a>

impl<'a> !Send for Timer<'a>

impl<'a> !Sync for Timer<'a>

impl<'a> Unpin for Timer<'a>

impl<'a> !UnwindSafe for Timer<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<R> ReadBytesExt for R where
    R: Read + ?Sized

impl<R> TermRead for R where
    R: TermReadEventsAndRaw + Read

impl<R> TermReadEventsAndRaw for R where
    R: Read

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.