Struct shardio::range::Range [−][src]
A range of points over the type K
, spanning the half-open interval [start
, end
). A value
of None
indicates that the interval is unbounded in that direction.
Fields
start: Option<K>
Start of interval
end: Option<K>
Inclusive end of interval
Implementations
impl<K: Ord + Clone> Range<K>
[src]
pub fn new(start: K, end: K) -> Range<K>
[src]
Create a Range object spanning the half-open interval [start
, `end)
pub fn starts_at(start: K) -> Range<K>
[src]
Create a range containing all points greater than or equal to start
pub fn ends_at(end: K) -> Range<K>
[src]
Create a range containing all points less than end
pub fn all() -> Range<K>
[src]
Create a range covering all points.
pub fn contains(&self, point: &K) -> bool
[src]
Test if point
in contained in the range self
pub fn intersects(&self, other: &Range<K>) -> bool
[src]
Test if Range other
intersects Range self
Trait Implementations
impl<K: Clone> Clone for Range<K>
[src]
impl<K: Copy> Copy for Range<K>
[src]
impl<K: Debug> Debug for Range<K>
[src]
impl<'de, K> Deserialize<'de> for Range<K> where
K: Deserialize<'de>,
[src]
K: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<K: Eq> Eq for Range<K>
[src]
impl<K: Ord> Ord for Range<K>
[src]
fn cmp(&self, other: &Range<K>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<K: PartialEq> PartialEq<Range<K>> for Range<K>
[src]
impl<K: PartialOrd> PartialOrd<Range<K>> for Range<K>
[src]
fn partial_cmp(&self, other: &Range<K>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<K> Serialize for Range<K> where
K: Serialize,
[src]
K: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<K> StructuralEq for Range<K>
[src]
impl<K> StructuralPartialEq for Range<K>
[src]
Auto Trait Implementations
impl<K> RefUnwindSafe for Range<K> where
K: RefUnwindSafe,
K: RefUnwindSafe,
impl<K> Send for Range<K> where
K: Send,
K: Send,
impl<K> Sync for Range<K> where
K: Sync,
K: Sync,
impl<K> Unpin for Range<K> where
K: Unpin,
K: Unpin,
impl<K> UnwindSafe for Range<K> where
K: UnwindSafe,
K: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,