pub struct EntityCoverage { /* private fields */ }Expand description
Independent index interval IDs for each ordered entity identity.
Explicit identities with empty coverage are preserved. An absent identity
is still treated as empty and returned as None by EntityCoverage::get.
Implementations§
Source§impl EntityCoverage
impl EntityCoverage
Sourcepub fn get(&self, identity: &EntityIdentity) -> Option<&Coverage>
pub fn get(&self, identity: &EntityIdentity) -> Option<&Coverage>
Borrow one identity’s coverage.
None means the identity is absent. Set operations treat absence as
empty coverage.
Sourcepub fn iter(&self) -> Iter<'_, EntityIdentity, Coverage> ⓘ
pub fn iter(&self) -> Iter<'_, EntityIdentity, Coverage> ⓘ
Iterate identities and their coverage in canonical order.
Sourcepub fn identity_count(&self) -> usize
pub fn identity_count(&self) -> usize
Number of stored identities.
Sourcepub fn union_coverage(&mut self, identity: EntityIdentity, coverage: Coverage)
pub fn union_coverage(&mut self, identity: EntityIdentity, coverage: Coverage)
Merge coverage for one identity.
Sourcepub fn union(&self, other: &Self) -> Self
pub fn union(&self, other: &Self) -> Self
Return the union of two entity-scoped coverage values.
Sourcepub fn union_inplace(&mut self, other: &Self)
pub fn union_inplace(&mut self, other: &Self)
Merge another entity-scoped coverage value into this one.
Sourcepub fn intersect(&self, other: &Self) -> Self
pub fn intersect(&self, other: &Self) -> Self
Return overlap only where both identity and index interval ID match.
Sourcepub fn cardinality(&self) -> u128
pub fn cardinality(&self) -> u128
Count covered (entity identity, index interval ID) pairs.
Sourcepub fn intersection_cardinality(&self, other: &Self) -> u128
pub fn intersection_cardinality(&self, other: &Self) -> u128
Count overlapping (entity identity, index interval ID) pairs.
Sourcepub fn first_overlapping_identity_and_interval_id<'a>(
&'a self,
other: &Self,
) -> Option<(&'a EntityIdentity, IndexIntervalId)>
pub fn first_overlapping_identity_and_interval_id<'a>( &'a self, other: &Self, ) -> Option<(&'a EntityIdentity, IndexIntervalId)>
Return the first canonical identity and smallest overlapping index interval ID.
Trait Implementations§
Source§impl Clone for EntityCoverage
impl Clone for EntityCoverage
Source§fn clone(&self) -> EntityCoverage
fn clone(&self) -> EntityCoverage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EntityCoverage
impl Debug for EntityCoverage
Source§impl Default for EntityCoverage
impl Default for EntityCoverage
Source§fn default() -> EntityCoverage
fn default() -> EntityCoverage
impl Eq for EntityCoverage
Source§impl PartialEq for EntityCoverage
impl PartialEq for EntityCoverage
impl StructuralPartialEq for EntityCoverage
Auto Trait Implementations§
impl Freeze for EntityCoverage
impl RefUnwindSafe for EntityCoverage
impl Send for EntityCoverage
impl Sync for EntityCoverage
impl Unpin for EntityCoverage
impl UnsafeUnpin for EntityCoverage
impl UnwindSafe for EntityCoverage
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more