pub trait Ranged {
type BoundType: Ord + Copy;
// Required method
fn range(&self) -> (Self::BoundType, Self::BoundType);
// Provided methods
fn overlap(&self, other: &Self) -> bool { ... }
fn overlap_inclusive(&self, other: &Self) -> bool { ... }
}Expand description
Trait for any items with specific range (both boundaries are inclusive).
Required Associated Types§
Required Methods§
Provided Methods§
fn overlap(&self, other: &Self) -> bool
Sourcefn overlap_inclusive(&self, other: &Self) -> bool
fn overlap_inclusive(&self, other: &Self) -> bool
Like overlap, but treats touching boundaries as overlapping (inclusive).
Used by find_overlapping_items where shared boundaries count as overlap.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".