embassy-executor

Crates

git

Versions

riscv32

Flavors

Metadata

Struct Metadata 

Source
pub struct Metadata { /* private fields */ }
Expand description

Metadata associated with a task.

Implementations§

Source§

impl Metadata

Source

pub fn for_current_task() -> impl Future<Output = &'static Self>

Get the metadata for the current task.

You can use this to read or modify the current task’s metadata.

This function is async just to get access to the current async context. It returns instantly, it does not block/yield.

Source

pub fn priority(&self) -> u8

Get this task’s priority.

Source

pub fn set_priority(&self, priority: u8)

Set this task’s priority.

Source

pub fn deadline(&self) -> u64

Get this task’s deadline.

Source

pub fn set_deadline(&self, instant_ticks: u64)

Set this task’s deadline.

This method does NOT check whether the deadline has already passed.

Source

pub fn unset_deadline(&self)

Remove this task’s deadline. This brings it back to the defaul where it’s not scheduled ahead of other tasks.

Source

pub fn increment_deadline(&self, duration_ticks: u64)

Set the this task’s deadline increment_ticks from the previous deadline.

This deadline is saturated to the max tick value.

Note that by default (unless otherwise set), tasks start life with the deadline not set, which means this method will have no effect.

Analogous to one increment of Ticker::every().next().

Returns the deadline that was set.

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.