pub struct IntegerBounds { /* private fields */ }Expand description
A canonical closed interval over signed 64-bit integers.
JSON Schema’s exclusive integer bounds are normalized to inclusive endpoints at parse time, so semantically identical intervals have one representation.
Implementations§
Source§impl IntegerBounds
impl IntegerBounds
Sourcepub fn new(lower: Option<i64>, upper: Option<i64>) -> Option<Self>
pub fn new(lower: Option<i64>, upper: Option<i64>) -> Option<Self>
Build a validated closed integer interval.
Returns None when both endpoints are present and lower > upper.
Sourcepub fn contains_i64(self, value: i64) -> bool
pub fn contains_i64(self, value: i64) -> bool
Return true when value is inside this interval.
Sourcepub fn contains_i128(self, value: i128) -> bool
pub fn contains_i128(self, value: i128) -> bool
Return true when value is inside this interval.
Sourcepub fn contains_bounds(self, sub: Self) -> bool
pub fn contains_bounds(self, sub: Self) -> bool
Return true when sub is wholly contained by this interval.
Sourcepub fn as_number_bounds(self) -> NumberBounds
pub fn as_number_bounds(self) -> NumberBounds
Project this integer interval into the corresponding number interval.
Trait Implementations§
Source§impl Clone for IntegerBounds
impl Clone for IntegerBounds
Source§fn clone(&self) -> IntegerBounds
fn clone(&self) -> IntegerBounds
Returns a duplicate 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 Debug for IntegerBounds
impl Debug for IntegerBounds
Source§impl PartialEq for IntegerBounds
impl PartialEq for IntegerBounds
impl Copy for IntegerBounds
impl Eq for IntegerBounds
impl StructuralPartialEq for IntegerBounds
Auto Trait Implementations§
impl Freeze for IntegerBounds
impl RefUnwindSafe for IntegerBounds
impl Send for IntegerBounds
impl Sync for IntegerBounds
impl Unpin for IntegerBounds
impl UnsafeUnpin for IntegerBounds
impl UnwindSafe for IntegerBounds
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§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.