pub trait OrderedTimerDequeHandle<MODE: OrderedTimerDequeMode>:
Ord
+ PartialOrd
+ PartialEq
+ PartialEq<Self::TimerId>
+ Eq
+ Debug
+ Display
+ OrderedTimerDequeInterf<MODE> {
type TimerId: PartialEq + Eq + Display + Debug;
type HandleRes: TimerTimeoutCollection<Self::TimerId>;
// Required methods
fn postpone(&mut self, postp_time: RelativeTime) -> TimerResult<()>;
fn resched(&mut self, time: MODE) -> TimerResult<()>;
fn handle(
self,
timer_self: &mut OrderTimerDeque<MODE, Self>,
timer_ids: &mut Self::HandleRes,
) -> TimerResult<()>
where Self: Sized;
fn is_same(&self, other: &Self::TimerId) -> bool;
fn into_timer_id(self) -> Option<Self::TimerId>;
}Expand description
A standart interface for each deque type. Every deque type must implement this trait.
Required Associated Types§
Sourcetype TimerId: PartialEq + Eq + Display + Debug
type TimerId: PartialEq + Eq + Display + Debug
A timer ID. Normally this is a uniq identificator of the item in the queue.
i.e TimerDequeId.
Sourcetype HandleRes: TimerTimeoutCollection<Self::TimerId>
type HandleRes: TimerTimeoutCollection<Self::TimerId>
A collection which is used to collect the items which are removed from the queue due to timeout.
Required Methods§
Sourcefn postpone(&mut self, postp_time: RelativeTime) -> TimerResult<()>
fn postpone(&mut self, postp_time: RelativeTime) -> TimerResult<()>
Postpones the timeout of the current instance. The postp_time is a RelativeTime
i.e inroduces the offset.
Sourcefn resched(&mut self, time: MODE) -> TimerResult<()>
fn resched(&mut self, time: MODE) -> TimerResult<()>
Reschedules the current instance. This is different from the postpone as the
instance is assagned with a new time. The MODE cannot be changed, only time.
Sourcefn handle(
self,
timer_self: &mut OrderTimerDeque<MODE, Self>,
timer_ids: &mut Self::HandleRes,
) -> TimerResult<()>where
Self: Sized,
fn handle(
self,
timer_self: &mut OrderTimerDeque<MODE, Self>,
timer_ids: &mut Self::HandleRes,
) -> TimerResult<()>where
Self: Sized,
A spefic code which is called during timeout routine handling. Normally is should
store the result into the collection and reschedule the item if it is repeated.
Sourcefn is_same(&self, other: &Self::TimerId) -> bool
fn is_same(&self, other: &Self::TimerId) -> bool
Matches the current instance with provided other instances
OrderedTimerDequeHandle::TimerId. But, the PartialEq<Self::TimerId> is
implemented, so the == can be used to compare.
Sourcefn into_timer_id(self) -> Option<Self::TimerId>
fn into_timer_id(self) -> Option<Self::TimerId>
Attempts to acquire the OrderedTimerDequeHandle::TimerId by consuming the instance.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.