pub struct BoundedI64<const MIN: i64, const MAX: i64>(pub i64);Expand description
A bounded i64
Tuple Fields§
§0: i64Implementations§
Source§impl<const MIN: i64, const MAX: i64> BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> BoundedI64<MIN, MAX>
Sourcepub const fn new(v: i64) -> Result<Self, Error>
pub const fn new(v: i64) -> Result<Self, Error>
Create a new bounded int with the given value in it, if it’s within bounds
Sourcepub const fn new_unwrap(v: i64) -> Self
pub const fn new_unwrap(v: i64) -> Self
Create a new bounded int with the given value in it; panics if the value is not within bounds
Sourcepub const fn new_static<const V: i64>() -> Self
pub const fn new_static<const V: i64>() -> Self
Create a new bounded int at compile time.
Checks arguments at compile time - for instance, the following doesn’t compile:
const Bounded : sqrid::U8Bounded<0,5> = sqrid::U8Bounded::<0,5>::new_static::<9>();Sourcepub const fn into_inner(self) -> i64
pub const fn into_inner(self) -> i64
Deconstructs an $name and returns the the inner value
Trait Implementations§
Source§impl<const MIN: i64, const MAX: i64> BoundedInt for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> BoundedInt for BoundedI64<MIN, MAX>
Source§fn into_inner(self) -> Self::Inner
fn into_inner(self) -> Self::Inner
Extract the inner value.
Source§fn checked_add(self, other: Self) -> Option<Self>
fn checked_add(self, other: Self) -> Option<Self>
Checked integer addition.
Source§fn checked_sub(self, other: Self) -> Option<Self>
fn checked_sub(self, other: Self) -> Option<Self>
Checked integer subtraction.
Source§fn iter() -> BoundedIntIterator<Self> ⓘ
fn iter() -> BoundedIntIterator<Self> ⓘ
Return an iterator for all values of this
BoundedInt type.Source§impl<const MIN: i64, const MAX: i64> Clone for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> Clone for BoundedI64<MIN, MAX>
Source§fn clone(&self) -> BoundedI64<MIN, MAX>
fn clone(&self) -> BoundedI64<MIN, MAX>
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<const MIN: i64, const MAX: i64> Default for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> Default for BoundedI64<MIN, MAX>
Source§fn default() -> BoundedI64<MIN, MAX>
fn default() -> BoundedI64<MIN, MAX>
Returns the “default value” for a type. Read more
Source§impl<const MIN: i64, const MAX: i64> From<BoundedI64<MIN, MAX>> for i64
impl<const MIN: i64, const MAX: i64> From<BoundedI64<MIN, MAX>> for i64
Source§fn from(value: BoundedI64<MIN, MAX>) -> i64
fn from(value: BoundedI64<MIN, MAX>) -> i64
Converts to this type from the input type.
Source§impl<const MIN: i64, const MAX: i64> Ord for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> Ord for BoundedI64<MIN, MAX>
Source§fn cmp(&self, other: &BoundedI64<MIN, MAX>) -> Ordering
fn cmp(&self, other: &BoundedI64<MIN, MAX>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<const MIN: i64, const MAX: i64> PartialOrd for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> PartialOrd for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> Copy for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> Eq for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> StructuralPartialEq for BoundedI64<MIN, MAX>
Auto Trait Implementations§
impl<const MIN: i64, const MAX: i64> Freeze for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> RefUnwindSafe for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> Send for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> Sync for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> Unpin for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> UnwindSafe for BoundedI64<MIN, MAX>
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