pub struct EventTag {
pub offset_from_t0: Duration,
pub microstep: MicroStep,
}Expand description
The tag of an event.
Tags correspond to a point on the logical timeline, and also implement superdense time, which means an infinite sequence of tags may be processed for any logical instant. The label on this sequence is called the microstep of the tag.
Use the tag! macro to create this struct with convenient syntax.
Fields§
§offset_from_t0: DurationThe time offset from the origin of the logical timeline. Knowing the start time of the application is necessary to convert this to an absolute Instant (see Self::to_logical_time).
microstep: MicroStepThe microstep of this tag.
Implementations§
Source§impl EventTag
impl EventTag
Sourcepub fn to_logical_time(&self, t0: Instant) -> Instant
pub fn to_logical_time(&self, t0: Instant) -> Instant
Returns the logical instant for this tag, using the
initial time t0.
Sourcepub fn duration_since_start(&self) -> Duration
pub fn duration_since_start(&self) -> Duration
Returns the amount of time elapsed since the start of the app.
assert_eq!(tag1.duration_since_start(), tag1.to_logical_time(t0) - t0)Trait Implementations§
Source§impl Ord for EventTag
impl Ord for EventTag
Source§impl PartialOrd for EventTag
impl PartialOrd for EventTag
impl Copy for EventTag
impl Eq for EventTag
impl StructuralPartialEq for EventTag
Auto Trait Implementations§
impl Freeze for EventTag
impl RefUnwindSafe for EventTag
impl Send for EventTag
impl Sync for EventTag
impl Unpin for EventTag
impl UnwindSafe for EventTag
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.