TimerQueueItem

Struct TimerQueueItem 

Source
#[repr(align(8))]
pub struct TimerQueueItem { /* private fields */ }
Expand description

The timer queue item provided by the executor.

This type is opaque, it only provides the raw storage for a queue item. The queue implementation is responsible for reinterpreting the contents of the item using TimerQueueItem::as_ref and TimerQueueItem::as_mut.

Implementations§

Source§

impl TimerQueueItem

Source

pub const fn new() -> Self

Creates a new, zero-initialized TimerQueueItem.

Source

pub unsafe fn from_embassy_waker(waker: &Waker) -> &'static mut Self

Retrieves the TimerQueueItem reference that belongs to the task of the waker.

Panics if called with a non-embassy waker.

§Safety

The caller must ensure they are not violating Rust’s aliasing rules - it is not allowed to use this method to create multiple mutable references to the same TimerQueueItem at the same time.

This function must only be called in the context of a timer queue implementation.

Source

pub unsafe fn as_ref<T>(&self) -> &T

Access the data as a reference to a type T.

Safety:

  • The type must be valid when zero-initialized.
  • The timer queue should only be interpreted as a single type T during its lifetime.
Source

pub unsafe fn as_mut<T>(&self) -> &mut T

Access the data as a reference to a type T.

Safety:

  • The type must be valid when zero-initialized.
  • The timer queue should only be interpreted as a single type T during its lifetime.

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.