pub type DeviceRange = DeviceRangeV32;
Expand description
Same as std::ops::Range but with Ord and PartialOrd support, sorted first by start of the range, then by the end.
Aliased Type§
struct DeviceRange(pub Range<u64>);
Fields§
§0: Range<u64>
Methods from Deref<Target = Range<u64>>§
1.35.0 · Sourcepub fn contains<U>(&self, item: &U) -> bool
pub fn contains<U>(&self, item: &U) -> bool
Returns true
if item
is contained in the range.
§Examples
assert!(!(3..5).contains(&2));
assert!( (3..5).contains(&3));
assert!( (3..5).contains(&4));
assert!(!(3..5).contains(&5));
assert!(!(3..3).contains(&3));
assert!(!(3..2).contains(&3));
assert!( (0.0..1.0).contains(&0.5));
assert!(!(0.0..1.0).contains(&f32::NAN));
assert!(!(0.0..f32::NAN).contains(&0.5));
assert!(!(f32::NAN..1.0).contains(&0.5));
1.47.0 · Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true
if the range contains no items.
§Examples
assert!(!(3..5).is_empty());
assert!( (3..3).is_empty());
assert!( (3..2).is_empty());
The range is empty if either side is incomparable:
assert!(!(3.0..5.0).is_empty());
assert!( (3.0..f32::NAN).is_empty());
assert!( (f32::NAN..5.0).is_empty());
Trait Implementations§
Source§impl Deref for DeviceRange
impl Deref for DeviceRange
Source§impl DerefMut for DeviceRange
impl DerefMut for DeviceRange
Source§impl Ord for DeviceRange
impl Ord for DeviceRange
Source§impl PartialOrd for DeviceRange
impl PartialOrd for DeviceRange
Source§impl Clone for DeviceRangeV32
impl Clone for DeviceRangeV32
Source§fn clone(&self) -> DeviceRangeV32
fn clone(&self) -> DeviceRangeV32
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DeviceRangeV32
impl Debug for DeviceRangeV32
Source§impl<'de> Deserialize<'de> for DeviceRangeV32
impl<'de> Deserialize<'de> for DeviceRangeV32
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more