pub struct BoundedIsize<const MIN: isize, const MAX: isize>(pub isize);Expand description
A bounded isize
Tuple Fields§
§0: isizeImplementations§
Source§impl<const MIN: isize, const MAX: isize> BoundedIsize<MIN, MAX>
impl<const MIN: isize, const MAX: isize> BoundedIsize<MIN, MAX>
Sourcepub const fn new(v: isize) -> Result<Self, Error>
pub const fn new(v: isize) -> 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: isize) -> Self
pub const fn new_unwrap(v: isize) -> 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: isize>() -> Self
pub const fn new_static<const V: isize>() -> 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) -> isize
pub const fn into_inner(self) -> isize
Deconstructs an $name and returns the the inner value
Trait Implementations§
Source§impl<const MIN: isize, const MAX: isize> BoundedInt for BoundedIsize<MIN, MAX>
impl<const MIN: isize, const MAX: isize> BoundedInt for BoundedIsize<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: isize, const MAX: isize> Clone for BoundedIsize<MIN, MAX>
impl<const MIN: isize, const MAX: isize> Clone for BoundedIsize<MIN, MAX>
Source§fn clone(&self) -> BoundedIsize<MIN, MAX>
fn clone(&self) -> BoundedIsize<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: isize, const MAX: isize> Default for BoundedIsize<MIN, MAX>
impl<const MIN: isize, const MAX: isize> Default for BoundedIsize<MIN, MAX>
Source§fn default() -> BoundedIsize<MIN, MAX>
fn default() -> BoundedIsize<MIN, MAX>
Returns the “default value” for a type. Read more
Source§impl<const MIN: isize, const MAX: isize> From<BoundedIsize<MIN, MAX>> for isize
impl<const MIN: isize, const MAX: isize> From<BoundedIsize<MIN, MAX>> for isize
Source§fn from(value: BoundedIsize<MIN, MAX>) -> isize
fn from(value: BoundedIsize<MIN, MAX>) -> isize
Converts to this type from the input type.
Source§impl<const MIN: isize, const MAX: isize> Ord for BoundedIsize<MIN, MAX>
impl<const MIN: isize, const MAX: isize> Ord for BoundedIsize<MIN, MAX>
Source§fn cmp(&self, other: &BoundedIsize<MIN, MAX>) -> Ordering
fn cmp(&self, other: &BoundedIsize<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: isize, const MAX: isize> PartialOrd for BoundedIsize<MIN, MAX>
impl<const MIN: isize, const MAX: isize> PartialOrd for BoundedIsize<MIN, MAX>
impl<const MIN: isize, const MAX: isize> Copy for BoundedIsize<MIN, MAX>
impl<const MIN: isize, const MAX: isize> Eq for BoundedIsize<MIN, MAX>
impl<const MIN: isize, const MAX: isize> StructuralPartialEq for BoundedIsize<MIN, MAX>
Auto Trait Implementations§
impl<const MIN: isize, const MAX: isize> Freeze for BoundedIsize<MIN, MAX>
impl<const MIN: isize, const MAX: isize> RefUnwindSafe for BoundedIsize<MIN, MAX>
impl<const MIN: isize, const MAX: isize> Send for BoundedIsize<MIN, MAX>
impl<const MIN: isize, const MAX: isize> Sync for BoundedIsize<MIN, MAX>
impl<const MIN: isize, const MAX: isize> Unpin for BoundedIsize<MIN, MAX>
impl<const MIN: isize, const MAX: isize> UnwindSafe for BoundedIsize<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