pub struct RangeBound<B, const UPPER: bool = false> {
pub inclusive: bool,
pub bound: Option<B>,
}
Expand description
Represents a terminal point of a range.
Fields§
§inclusive: bool
§bound: Option<B>
None value represents an infinite bound.
Implementations§
Source§impl<'a, const UPPER: bool, B: Copy + Ord + PartialOrd + Display + Debug> RangeBound<B, UPPER>
impl<'a, const UPPER: bool, B: Copy + Ord + PartialOrd + Display + Debug> RangeBound<B, UPPER>
Sourcefn elem_cmp<T: RangeOps<'a>>(&self, elem: &T) -> Ordering
fn elem_cmp<T: RangeOps<'a>>(&self, elem: &T) -> Ordering
Determines where elem
lies in relation to the range bound.
§Panics
- If
self.bound.datum()
is not convertible toT
.
Sourcefn satisfied_by<T: RangeOps<'a>>(&self, elem: &T) -> bool
fn satisfied_by<T: RangeOps<'a>>(&self, elem: &T) -> bool
Does elem
satisfy this bound?
fn range_bound_cmp<const OTHER_UPPER: bool>( &self, other: &RangeBound<B, OTHER_UPPER>, ) -> Ordering
Source§impl<'a, const UPPER: bool> RangeBound<Datum<'a>, UPPER>
impl<'a, const UPPER: bool> RangeBound<Datum<'a>, UPPER>
Sourcepub fn new(d: Datum<'a>, inclusive: bool) -> RangeBound<Datum<'a>, UPPER>
pub fn new(d: Datum<'a>, inclusive: bool) -> RangeBound<Datum<'a>, UPPER>
Create a new RangeBound
whose value is “infinite” (i.e. None) if d == Datum::Null
, otherwise finite (i.e. Some).
There is not a corresponding generic implementation of this because genericizing how to express infinite bounds is less clear.
Sourcefn canonicalize(&mut self) -> Result<(), InvalidRangeError>
fn canonicalize(&mut self) -> Result<(), InvalidRangeError>
Rewrite the bounds to the consistent format. This is absolutely necessary to perform the correct equality/comparison operations on types.
Sourcefn canonicalize_inner<T: RangeOps<'a>>(
&mut self,
d: Datum<'a>,
) -> Result<(), InvalidRangeError>
fn canonicalize_inner<T: RangeOps<'a>>( &mut self, d: Datum<'a>, ) -> Result<(), InvalidRangeError>
Canonicalize self
’s representation for types that have discrete steps
between values.
Continuous values (e.g. timestamps, numeric) must not be canonicalized.
Trait Implementations§
Source§impl<B: Clone, const UPPER: bool> Clone for RangeBound<B, UPPER>
impl<B: Clone, const UPPER: bool> Clone for RangeBound<B, UPPER>
Source§fn clone(&self) -> RangeBound<B, UPPER>
fn clone(&self) -> RangeBound<B, UPPER>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<const UPPER: bool, D: Ord> Ord for RangeBound<D, UPPER>
impl<const UPPER: bool, D: Ord> Ord for RangeBound<D, UPPER>
Source§impl<const UPPER: bool, D: PartialOrd + Ord> PartialOrd for RangeBound<D, UPPER>
impl<const UPPER: bool, D: PartialOrd + Ord> PartialOrd for RangeBound<D, UPPER>
impl<B: Copy, const UPPER: bool> Copy for RangeBound<B, UPPER>
impl<B: Eq, const UPPER: bool> Eq for RangeBound<B, UPPER>
impl<B, const UPPER: bool> StructuralPartialEq for RangeBound<B, UPPER>
Auto Trait Implementations§
impl<B, const UPPER: bool> Freeze for RangeBound<B, UPPER>where
B: Freeze,
impl<B, const UPPER: bool> RefUnwindSafe for RangeBound<B, UPPER>where
B: RefUnwindSafe,
impl<B, const UPPER: bool> Send for RangeBound<B, UPPER>where
B: Send,
impl<B, const UPPER: bool> Sync for RangeBound<B, UPPER>where
B: Sync,
impl<B, const UPPER: bool> Unpin for RangeBound<B, UPPER>where
B: Unpin,
impl<B, const UPPER: bool> UnwindSafe for RangeBound<B, UPPER>where
B: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
Source§impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PreferredContainer for T
impl<T> PreferredContainer for T
Source§impl<T> ProgressEventTimestamp for T
impl<T> ProgressEventTimestamp for T
Source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
Source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
See
RustType::from_proto
.Source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
See
RustType::into_proto
.Source§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
Source§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
The method of
std::ops::AddAssign
, for types that do not implement AddAssign
.