pub trait EventSet:
Clone
+ Debug
+ Default {
type EventIter: Iterator<Item = u64>;
Show 14 methods
// Required methods
fn new() -> Self;
fn next_event(&mut self) -> u64;
fn add_event(&mut self, event: u64) -> bool;
fn is_event(&self, event: u64) -> bool;
fn events(&self) -> (u64, Vec<u64>);
fn frontier(&self) -> u64;
fn join(&mut self, other: &Self);
fn meet(&mut self, other: &Self);
fn subtracted(&self, other: &Self) -> Vec<u64>;
fn event_iter(self) -> Self::EventIter;
// Provided methods
fn from_event(event: u64) -> Self { ... }
fn from_event_range(start: u64, end: u64) -> Self { ... }
fn from_events<I: IntoIterator<Item = u64>>(iter: I) -> Self { ... }
fn add_event_range(&mut self, start: u64, end: u64) -> bool { ... }
}Expand description
EventSet trait to be implemented by MaxSet, BelowExSet and AboveExSet.
Required Associated Types§
Required Methods§
Sourcefn next_event(&mut self) -> u64
fn next_event(&mut self) -> u64
Generates the next event.
Sourcefn events(&self) -> (u64, Vec<u64>)
fn events(&self) -> (u64, Vec<u64>)
Returns all events seen as a pair.
For MaxSet:
- the first component is the highest event
- the second component is empty
For BelowExSet:
- the first component is the highest event
- the second component is a set of exceptions
For AboveExSet:
- the first component is the highest event in a contiguous sequence
- the second component is a set of outstanding events
If we’ve seen events [1, 2, 3, 5, 6], this function returns in
MaxSet: (6, [])BelowExSet: (6, [4])AboveExSet: (3, [5, 6])
Sourcefn subtracted(&self, other: &Self) -> Vec<u64>
fn subtracted(&self, other: &Self) -> Vec<u64>
Return a list of events that remain when other is subtracted from
self.
Sourcefn event_iter(self) -> Self::EventIter
fn event_iter(self) -> Self::EventIter
Returns an iterator containing all elements represented by this event set.
Provided Methods§
Sourcefn from_event(event: u64) -> Self
fn from_event(event: u64) -> Self
Creates a new instance from event.
Sourcefn from_event_range(start: u64, end: u64) -> Self
fn from_event_range(start: u64, end: u64) -> Self
Creates a new instance from a range of events.
Sourcefn from_events<I: IntoIterator<Item = u64>>(iter: I) -> Self
fn from_events<I: IntoIterator<Item = u64>>(iter: I) -> Self
Creates a new instance from several events.
Sourcefn add_event_range(&mut self, start: u64, end: u64) -> bool
fn add_event_range(&mut self, start: u64, end: u64) -> bool
Adds a range of events to the set.
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.