Struct postgres_range::Range [] [src]

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

Represents a range of values.

Methods

impl<T> Range<T> where T: PartialOrd + Normalizable

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

Creates a new range.

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

fn empty() -> Range<T>

Creates a new empty range.

fn is_empty(&self) -> bool

Determines if this range is the empty range.

fn lower(&self) -> Option<&RangeBound<LowerBound, T>>

Returns the lower bound if it exists.

fn upper(&self) -> Option<&RangeBound<UpperBound, T>>

Returns the upper bound if it exists.

fn contains(&self, value: &T) -> bool

Determines if a value lies within this range.

fn contains_range(&self, other: &Range<T>) -> bool

Determines if a range lies completely within this range.

impl<T> Range<T> where T: PartialOrd + Normalizable + Clone

fn intersect(&self, other: &Range<T>) -> Range<T>

Returns the intersection of this range with another.

fn union(&self, other: &Range<T>) -> Option<Range<T>>

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

Trait Implementations

impl<T> FromSql for Range<T> where T: PartialOrd + Normalizable + FromSql

fn from_sql<R: Read>(ty: &Type, rdr: &mut R, info: &SessionInfo) -> Result<Range<T>>

fn accepts(ty: &Type) -> bool

fn from_sql_null(ty: &Type, ctx: &SessionInfo) -> Result<Self, Error>

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

fn to_sql<W: ?Sized + Write>(&self, ty: &Type, buf: &mut W, info: &SessionInfo) -> Result<IsNull>

fn accepts(ty: &Type) -> bool

fn to_sql_checked(&self, ty: &Type, out: &mut Write, ctx: &SessionInfo) -> Result<IsNull>

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

fn fmt(&self, fmt: &mut Formatter) -> Result

Derived Implementations

impl<T: Copy> Copy for Range<T>

impl<T: Clone> Clone for Range<T>

fn clone(&self) -> Range<T>

fn clone_from(&mut self, source: &Self)

impl<T: Eq> Eq for Range<T>

impl<T: PartialEq> PartialEq for Range<T>

fn eq(&self, __arg_0: &Range<T>) -> bool

fn ne(&self, __arg_0: &Range<T>) -> bool

impl<T: Debug> Debug for Range<T>

fn fmt(&self, __arg_0: &mut Formatter) -> Result