Api

Trait Api 

Source
pub trait Api: Send {
    const MAX_TIME: u64;

    // Required method
    fn time() -> u64;

    // Provided method
    fn println(line: &str) { ... }
}
Expand description

Debugging and testing interface.

Required Associated Constants§

Source

const MAX_TIME: u64

Maximum value returned by Self::time() before wrapping.

Required Methods§

Source

fn time() -> u64

Returns the time in micro-seconds since some initial event.

This wraps once Self::MAX_TIME is reached. In particular, a maximum value of zero equivalent to not supporting this API.

Provided Methods§

Source

fn println(line: &str)

Prints a line with timestamp.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Api for Impl

Source§

const MAX_TIME: u64 = 0u64