[−][src]Struct esl01_dag::spanset::SpanSet
A set of integer spans.
Methods
impl SpanSet
[src]
pub fn from_spans<T: Into<Span>, I: IntoIterator<Item = T>>(spans: I) -> Self
[src]
Construct a SpanSet
containing given spans.
Overlapped spans will be merged automatically.
pub fn from_sorted_spans<T: Into<Span>, I: IntoIterator<Item = T>>(
spans: I
) -> Self
[src]
spans: I
) -> Self
Construct a SpanSet
containing given spans.
The given spans must be already sorted (i.e. larger ids first), and do
not have overlapped spans.
pub fn empty() -> Self
[src]
Construct an empty SpanSet
.
pub fn full() -> Self
[src]
Construct a full SpanSet
that contains everything.
Warning: The Id
in this set might be unknown to an actual storage.
pub fn is_empty(&self) -> bool
[src]
Check if this SpanSet
contains nothing.
pub fn count(&self) -> u64
[src]
Count integers covered by this SpanSet
.
pub fn contains(&self, value: impl Into<Span>) -> bool
[src]
pub fn union(&self, rhs: &SpanSet) -> SpanSet
[src]
Calculates the union of two sets.
pub fn intersection(&self, rhs: &SpanSet) -> SpanSet
[src]
Calculates the intersection of two sets.
pub fn difference(&self, rhs: &SpanSet) -> SpanSet
[src]
Calculates spans that are included only by this set, not rhs
.
pub fn iter(&self) -> SpanSetIter<&SpanSet>
[src]
Get an iterator for integers in this SpanSet
.
By default, the iteration is in descending order.
pub fn max(&self) -> Option<Id>
[src]
Get the maximum id in this set.
pub fn min(&self) -> Option<Id>
[src]
Get the minimal id in this set.
pub fn as_spans(&self) -> &Vec<Span>
[src]
Get a reference to the spans.
pub fn push(&mut self, span: impl Into<Span>)
[src]
Make this SpanSet
contain the specified span
.
The current implementation works best if span.high
is smaller than
min()
.
Trait Implementations
impl AsRef<SpanSet> for SpanSet
[src]
impl Clone for SpanSet
[src]
impl Debug for SpanSet
[src]
impl From<(Id, Id)> for SpanSet
[src]
impl<'a> From<(LegacyCodeNeedIdAccess, &'a DagSet)> for SpanSet
[src]
impl<T: Into<Span>> From<T> for SpanSet
[src]
impl IntoIterator for SpanSet
[src]
type Item = Id
The type of the elements being iterated over.
type IntoIter = SpanSetIter<SpanSet>
Which kind of iterator are we turning this into?
fn into_iter(self) -> SpanSetIter<SpanSet>
[src]
Get an iterator for integers in this SpanSet
.
Auto Trait Implementations
impl RefUnwindSafe for SpanSet
impl Send for SpanSet
impl Sync for SpanSet
impl Unpin for SpanSet
impl UnwindSafe for SpanSet
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
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>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
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>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,