pub struct BellRinger {
    bells: ArrayDeque<Bell, APPS>,
}
Expand description

Manages and activates time-triggered activities.

The Bellringer is regularly activated and checks whether any of the bells should ring. The bells are stored in a queue that is managed by the Bellringer. A clever implementation avoids iterating through the whole list for every iteration by keeping the bells sorted and storing delta times. This approach leads to a complexity of O(1) for the method called by the timer interrupt in case no bells need to be rung.

Fields§

§bells: ArrayDeque<Bell, APPS>

Implementations§

source§

impl BellRinger

source

pub const fn new() -> Self

source

pub fn sleep(&mut self, scheduler: &mut Scheduler, ms: usize)

Blocks the current thread for the number of milliseconds

source

pub fn check(&mut self, scheduler: &mut Scheduler)

Wakes up waiting threads

source

pub fn is_empty(&self) -> bool

Auto Trait Implementations§

§

impl RefUnwindSafe for BellRinger

§

impl Send for BellRinger

§

impl Sync for BellRinger

§

impl Unpin for BellRinger

§

impl UnwindSafe for BellRinger

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where 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>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where 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>

Performs the conversion.