[][src]Struct esl01_dag::spanset::SpanSet

pub struct SpanSet { /* fields omitted */ }

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]

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]

Tests if a given Id or Span is covered by this set.

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

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?

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,