[−][src]Struct climer::timer::Timer
Fields
running: bool
finished: bool
Methods
impl Timer
[src]
pub fn builder() -> TimerBuilder
[src]
Returns a new TimerBuilder
.
pub fn new<T, U>(
time: T,
format: Option<U>,
output: Option<Output>
) -> ClimerResult<Self> where
T: ToString,
U: ToString,
[src]
time: T,
format: Option<U>,
output: Option<Output>
) -> ClimerResult<Self> where
T: ToString,
U: ToString,
Create a new Timer
with the given time
(string) and
optional format
(string) and output
(Output
).
pub fn run(&mut self) -> ClimerResult
[src]
Run the timer.
This will lock the current thread until the time is up.
If you want to update the timer yourself somewhere else,
then don't call this method, instead call the update
method to update the timer.
pub fn start(&mut self) -> ClimerResult
[src]
Start the timer. Do not call this method directly if you are using the run
method.
Only call this method if you intend to update the timer manually
by calling the update
method.
pub fn stop(&mut self) -> ClimerResult
[src]
Stops the timer, after it has been started using the start
method.
pub fn update(&mut self) -> ClimerResult
[src]
Updates the timer.
This will also attempt to write the remaining time to stdout or to a file,
using the Output
of this Timer
.
pub fn time_output(&self) -> Time
[src]
Returns a Time
with the passed time since the timer started.
Auto Trait Implementations
impl Sync for Timer
impl Unpin for Timer
impl Send for Timer
impl UnwindSafe for Timer
impl RefUnwindSafe for Timer
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,