[−][src]Struct postgres_range::Range
Represents a range of values.
Methods
impl<T> Range<T> where
T: PartialOrd + Normalizable,
[src]
T: PartialOrd + Normalizable,
pub fn new(
lower: Option<RangeBound<LowerBound, T>>,
upper: Option<RangeBound<UpperBound, T>>
) -> Range<T>
[src]
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.
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]
T: PartialOrd + Normalizable + Clone,
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]
T: Display,
impl<T: Eq> Eq for Range<T>
[src]
impl<'a, T> FromSql<'a> for Range<T> where
T: PartialOrd + Normalizable + FromSql<'a>,
[src]
T: PartialOrd + Normalizable + FromSql<'a>,
fn from_sql(
ty: &Type,
raw: &'a [u8]
) -> Result<Range<T>, Box<dyn Error + Sync + Send>>
[src]
ty: &Type,
raw: &'a [u8]
) -> Result<Range<T>, Box<dyn Error + Sync + Send>>
fn accepts(ty: &Type) -> bool
[src]
fn from_sql_null(
ty: &Type
) -> Result<Self, Box<dyn Error + 'static + Sync + Send>>
[src]
ty: &Type
) -> Result<Self, Box<dyn Error + 'static + Sync + Send>>
fn from_sql_nullable(
ty: &Type,
raw: Option<&'a [u8]>
) -> Result<Self, Box<dyn Error + 'static + Sync + Send>>
[src]
ty: &Type,
raw: Option<&'a [u8]>
) -> Result<Self, Box<dyn Error + 'static + Sync + Send>>
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]
T: PartialOrd + Normalizable + ToSql,
Auto Trait Implementations
impl<T> RefUnwindSafe for Range<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Range<T> where
T: Send,
T: Send,
impl<T> Sync for Range<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Range<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Range<T> where
T: UnwindSafe,
T: 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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> FromSqlOwned for T where
T: FromSql<'a>,
[src]
T: FromSql<'a>,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,