pub struct Activations { /* private fields */ }
Expand description

Allocation-free activation tracker.

Implementations§

source§

impl Activations

source

pub fn new(timer: Instant) -> Self

Creates a new activation tracker.

source

pub fn activate(&mut self, path: &[usize])

Activates the task addressed by path.

source

pub fn activate_after(&mut self, path: &[usize], delay: Duration)

Schedules a future activation for the task addressed by path.

source

pub fn advance(&mut self)

Discards the current active set and presents the next active set.

source

pub fn map_active(&self, logic: impl Fn(&[usize]))

Maps a function across activated paths.

source

pub fn for_extensions(&self, path: &[usize], action: impl FnMut(usize))

Sets as active any symbols that follow path.

source

pub fn sync(&self) -> SyncActivations

Constructs a thread-safe SyncActivations handle to this activator.

source

pub fn empty_for(&self) -> Option<Duration>

Time until next scheduled event.

This method should be used before putting a worker thread to sleep, as it indicates the amount of time before the thread should be unparked for the next scheduled activation.

Trait Implementations§

source§

impl Debug for Activations

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> PushInto<Vec<T>> for T

source§

fn push_into(self, target: &mut Vec<T>)

Push self into the target container.
source§

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

§

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>,

§

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.