Trait pubgrub::version_set::VersionSet
source · 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§
Required Methods§
sourcefn complement(&self) -> Self
fn complement(&self) -> Self
Compute the complement of this set.
sourcefn intersection(&self, other: &Self) -> Self
fn intersection(&self, other: &Self) -> Self
Compute the intersection with another set.
Provided Methods§
sourcefn full() -> Self
fn full() -> Self
Constructor for the set containing all versions.
Automatically implemented as Self::empty().complement()
.
sourcefn union(&self, other: &Self) -> Self
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()
sourcefn is_disjoint(&self, other: &Self) -> bool
fn is_disjoint(&self, other: &Self) -> bool
Whether the range have no overlapping segmets
Object Safety§
This trait is not object safe.