pub trait VersionSet: Debug + Display + Clone + Eq {
    type V: Debug + Display + Clone + Ord;

    // Required methods
    fn empty() -> Self;
    fn singleton(v: Self::V) -> Self;
    fn complement(&self) -> Self;
    fn intersection(&self, other: &Self) -> Self;
    fn contains(&self, v: &Self::V) -> bool;

    // Provided methods
    fn full() -> Self { ... }
    fn union(&self, other: &Self) -> Self { ... }
    fn is_disjoint(&self, other: &Self) -> bool { ... }
    fn subset_of(&self, other: &Self) -> bool { ... }
}
Expand description

Trait describing sets of versions.

Required Associated Types§

source

type V: Debug + Display + Clone + Ord

Version type associated with the sets manipulated.

Required Methods§

source

fn empty() -> Self

Constructor for an empty set containing no version.

source

fn singleton(v: Self::V) -> Self

Constructor for a set containing exactly one version.

source

fn complement(&self) -> Self

Compute the complement of this set.

source

fn intersection(&self, other: &Self) -> Self

Compute the intersection with another set.

source

fn contains(&self, v: &Self::V) -> bool

Evaluate membership of a version in this set.

Provided Methods§

source

fn full() -> Self

Constructor for the set containing all versions. Automatically implemented as Self::empty().complement().

source

fn union(&self, other: &Self) -> Self

Compute the union with another set. Thanks to set properties, this is automatically implemented as: self.complement().intersection(&other.complement()).complement()

source

fn is_disjoint(&self, other: &Self) -> bool

Whether the range have no overlapping segmets

source

fn subset_of(&self, other: &Self) -> bool

Whether all range of self are contained in other

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T: Debug + Display + Clone + Eq + Ord> VersionSet for Range<T>

§

type V = T