Struct sixtyfps::Timer[]

pub struct Timer { /* fields omitted */ }
Expand description

Timer is a handle to the timer system that allows triggering a callback to be called after a specified period of time.

Implementations

Starts the timer with the given mode and duration, in order for the callback to called when the timer fires. If the timer has been started previously and not fired yet, then it will be restarted.

Arguments:

  • mode: The timer mode to apply, i.e. whether to repeatedly fire the timer or just once.
  • duration: The duration from now until when the timer should fire.
  • callback: The function to call when the time has been reached or exceeded.

Starts the timer with the duration, in order for the callback to called when the timer fires. It is fired only once and then deleted.

Arguments:

  • duration: The duration from now until when the timer should fire.
  • callback: The function to call when the time has been reached or exceeded.

Stops the previously started timer. Does nothing if the timer has never been started. A stopped timer cannot be restarted with restart() – instead you need to call start().

Restarts the timer, if it was previously started.

Returns true if the timer is running; false otherwise.

Trait Implementations

Returns the “default value” for a type. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.