TimerEntries

Struct TimerEntries 

Source
pub struct TimerEntries {
    pub entries: BTreeMap<usize, TimerEntry>,
}
Expand description

定时器条目集合

Fields§

§entries: BTreeMap<usize, TimerEntry>

Implementations§

Source§

impl TimerEntries

Source

pub fn new() -> Self

创建一个新的定时器条目集合

Source

pub fn push(&mut self, trigger_time: usize, entry: TimerEntry)

向集合中添加一个定时器条目

§参数:
  • trigger_time: 触发时间点
  • entry: 定时器条目
Source

pub fn pop_due_entry(&mut self, current_time: usize) -> Option<TimerEntry>

弹出已到期的定时器条目

§参数:
  • current_time: 当前时间点
§返回值:
  • 已到期的定时器条目(如果有)
Source

pub fn find_entry( &self, task: &Arc<SpinLock<Task>>, sig: usize, ) -> Option<(&usize, &TimerEntry)>

查找与指定任务关联的定时器条目

§参数:
  • task: 目标任务
§返回值:
  • 关联的定时器条目(如果存在)
Source

pub fn remove_entry( &mut self, task: &Arc<SpinLock<Task>>, sig: usize, ) -> Option<TimerEntry>

移除与指定任务关联的定时器条目

§参数:
  • task: 目标任务
§返回值:
  • 被移除的定时器条目(如果存在)

Auto Trait Implementations§

§

impl Freeze for TimerEntries

§

impl !RefUnwindSafe for TimerEntries

§

impl Send for TimerEntries

§

impl Sync for TimerEntries

§

impl Unpin for TimerEntries

§

impl !UnwindSafe for TimerEntries

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.