[][src]Struct shardio::range::Range

pub struct Range<K> {
    pub start: Option<K>,
    pub end: Option<K>,
}

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>end: Option<K>

Methods

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

pub fn cmp(&self, point: &K) -> Rorder[src]

Trait Implementations

impl<K: PartialEq> PartialEq<Range<K>> for Range<K>[src]

impl<K: Clone> Clone for Range<K>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<K: Ord> Ord for Range<K>[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl<K: Eq> Eq for Range<K>[src]

impl<K: PartialOrd> PartialOrd<Range<K>> for Range<K>[src]

impl<K: Copy> Copy for Range<K>[src]

impl<K: Debug> Debug for Range<K>[src]

impl<K> Serialize for Range<K> where
    K: Serialize
[src]

impl<'de, K> Deserialize<'de> for Range<K> where
    K: Deserialize<'de>, 
[src]

Auto Trait Implementations

impl<K> Send for Range<K> where
    K: Send

impl<K> Sync for Range<K> where
    K: Sync

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]