Struct postgres_range::Range[][src]

pub struct Range<T> { /* fields omitted */ }

Represents a range of values.

Implementations

impl<T> Range<T> where
    T: PartialOrd + Normalizable
[src]

pub fn new(
    lower: Option<RangeBound<LowerBound, T>>,
    upper: Option<RangeBound<UpperBound, T>>
) -> Range<T>
[src]

Creates a new range.

If a bound is None, the range is unbounded in that direction.

pub fn empty() -> Range<T>[src]

Creates a new empty range.

pub fn is_empty(&self) -> bool[src]

Determines if this range is the empty range.

pub fn lower(&self) -> Option<&RangeBound<LowerBound, T>>[src]

Returns the lower bound if it exists.

pub fn upper(&self) -> Option<&RangeBound<UpperBound, T>>[src]

Returns the upper bound if it exists.

pub fn contains(&self, value: &T) -> bool[src]

Determines if a value lies within this range.

pub fn contains_range(&self, other: &Range<T>) -> bool[src]

Determines if a range lies completely within this range.

impl<T> Range<T> where
    T: PartialOrd + Normalizable + Clone
[src]

pub fn intersect(&self, other: &Range<T>) -> Range<T>[src]

Returns the intersection of this range with another.

pub fn union(&self, other: &Range<T>) -> Option<Range<T>>[src]

Returns the union of this range with another if it is contiguous.

Trait Implementations

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

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

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

impl<T> Display for Range<T> where
    T: Display
[src]

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

impl<'a, T> FromSql<'a> for Range<T> where
    T: PartialOrd + Normalizable + FromSql<'a>, 
[src]

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

impl<T> StructuralEq for Range<T>[src]

impl<T> StructuralPartialEq for Range<T>[src]

impl<T> ToSql for Range<T> where
    T: PartialOrd + Normalizable + ToSql
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Range<T> where
    T: RefUnwindSafe

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

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

impl<T> Unpin for Range<T> where
    T: Unpin

impl<T> UnwindSafe for Range<T> where
    T: UnwindSafe

Blanket Implementations

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

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

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

impl<T> BorrowToSql for T where
    T: ToSql
[src]

impl<T> From<T> for T[src]

impl<T> FromSqlOwned for T where
    T: for<'a> FromSql<'a>, 
[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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<V, T> VZip<V> for T where
    V: MultiLane<T>,