Trait rtic_time::timer_queue::TimerQueueTicks

source ·
pub trait TimerQueueTicks:
    Copy
    + PartialEq
    + Eq {
    const ONE_TICK: Self;

    // Required methods
    fn compare(self, other: Self) -> Ordering;
    fn wrapping_add(self, other: Self) -> Self;

    // Provided method
    fn is_at_least(self, other: Self) -> bool { ... }
}
Expand description

The ticks of a timer.

Required Associated Constants§

source

const ONE_TICK: Self

Represents a single tick.

Required Methods§

source

fn compare(self, other: Self) -> Ordering

Compares to another tick count.

Takes into account timer wrapping; if the difference is more than half the value range, the result will be flipped.

source

fn wrapping_add(self, other: Self) -> Self

Wrapping addition.

Provided Methods§

source

fn is_at_least(self, other: Self) -> bool

True if self is at the same time as other or later.

Takes into account timer wrapping; if the difference is more than half the value range, the result will be negated.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl TimerQueueTicks for u32

source§

const ONE_TICK: Self = 1u32

source§

fn compare(self, other: Self) -> Ordering

source§

fn wrapping_add(self, other: Self) -> Self

source§

impl TimerQueueTicks for u64

source§

const ONE_TICK: Self = 1u64

source§

fn compare(self, other: Self) -> Ordering

source§

fn wrapping_add(self, other: Self) -> Self

Implementors§