pub struct IntervalBound {
pub value: ScalarValue,
pub open: bool,
}
Expand description
This type represents a single endpoint of an Interval
. An endpoint can
be open or closed, denoting whether the interval includes or excludes the
endpoint itself.
Fields§
§value: ScalarValue
§open: bool
Implementations§
source§impl IntervalBound
impl IntervalBound
sourcepub const fn new(value: ScalarValue, open: bool) -> IntervalBound
pub const fn new(value: ScalarValue, open: bool) -> IntervalBound
Creates a new IntervalBound
object using the given value.
sourcepub fn make_unbounded<T: Borrow<DataType>>(data_type: T) -> Result<Self>
pub fn make_unbounded<T: Borrow<DataType>>(data_type: T) -> Result<Self>
This convenience function creates an unbounded interval endpoint.
sourcepub fn get_datatype(&self) -> DataType
pub fn get_datatype(&self) -> DataType
This convenience function returns the data type associated with this
IntervalBound
.
sourcepub fn is_unbounded(&self) -> bool
pub fn is_unbounded(&self) -> bool
This convenience function checks whether the IntervalBound
represents
an unbounded interval endpoint.
sourcepub fn add<const UPPER: bool, T: Borrow<IntervalBound>>(
&self,
other: T
) -> Result<IntervalBound>
pub fn add<const UPPER: bool, T: Borrow<IntervalBound>>( &self, other: T ) -> Result<IntervalBound>
This function adds the given IntervalBound
to this IntervalBound
.
The result is unbounded if either is; otherwise, their values are
added. The result is closed if both original bounds are closed, or open
otherwise.
sourcepub fn sub<const UPPER: bool, T: Borrow<IntervalBound>>(
&self,
other: T
) -> Result<IntervalBound>
pub fn sub<const UPPER: bool, T: Borrow<IntervalBound>>( &self, other: T ) -> Result<IntervalBound>
This function subtracts the given IntervalBound
from self
.
The result is unbounded if either is; otherwise, their values are
subtracted. The result is closed if both original bounds are closed,
or open otherwise.
sourcepub fn choose(
first: &IntervalBound,
second: &IntervalBound,
decide: fn(_: &ScalarValue, _: &ScalarValue) -> Result<ScalarValue>
) -> Result<IntervalBound>
pub fn choose( first: &IntervalBound, second: &IntervalBound, decide: fn(_: &ScalarValue, _: &ScalarValue) -> Result<ScalarValue> ) -> Result<IntervalBound>
This function chooses one of the given IntervalBound
s according to
the given function decide
. The result is unbounded if both are. If
only one of the arguments is unbounded, the other one is chosen by
default. If neither is unbounded, the function decide
is used.
Trait Implementations§
source§impl Clone for IntervalBound
impl Clone for IntervalBound
source§fn clone(&self) -> IntervalBound
fn clone(&self) -> IntervalBound
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for IntervalBound
impl Debug for IntervalBound
source§impl Display for IntervalBound
impl Display for IntervalBound
source§impl PartialEq<IntervalBound> for IntervalBound
impl PartialEq<IntervalBound> for IntervalBound
source§fn eq(&self, other: &IntervalBound) -> bool
fn eq(&self, other: &IntervalBound) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for IntervalBound
impl StructuralEq for IntervalBound
impl StructuralPartialEq for IntervalBound
Auto Trait Implementations§
impl RefUnwindSafe for IntervalBound
impl Send for IntervalBound
impl Sync for IntervalBound
impl Unpin for IntervalBound
impl UnwindSafe for IntervalBound
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.