Struct extendr_api::prelude::utils::constrained::Size
source · pub struct Size<'n>(/* private fields */);Expand description
usize value tied to the lifetime 'n.
Implementations§
source§impl<'size> Size<'size>
impl<'size> Size<'size>
sourcepub fn with<R>(n: usize, f: impl for<'n> FnOnce(Size<'n>) -> R) -> R
pub fn with<R>(n: usize, f: impl for<'n> FnOnce(Size<'n>) -> R) -> R
Create a new Size with a lifetime tied to n.
sourcepub fn with2<R>(
m: usize,
n: usize,
f: impl for<'m, 'n> FnOnce(Size<'m>, Size<'n>) -> R,
) -> R
pub fn with2<R>( m: usize, n: usize, f: impl for<'m, 'n> FnOnce(Size<'m>, Size<'n>) -> R, ) -> R
Create two new Size with lifetimes tied to m and n.
sourcepub unsafe fn new_raw_unchecked(n: usize) -> Size<'size>
pub unsafe fn new_raw_unchecked(n: usize) -> Size<'size>
Create a new Size tied to the lifetime 'n.
sourcepub fn into_inner(self) -> usize
pub fn into_inner(self) -> usize
Returns the unconstrained value.
sourcepub fn indices(self) -> impl DoubleEndedIterator
pub fn indices(self) -> impl DoubleEndedIterator
Returns an iterator of the indices smaller than self.
Methods from Deref<Target = usize>§
pub const MIN: usize = 0usize
pub const MAX: usize = 18_446_744_073_709_551_615usize
pub const BITS: u32 = 64u32
Trait Implementations§
source§impl<'n> Ord for Size<'n>
impl<'n> Ord for Size<'n>
source§impl<'n> PartialEq for Size<'n>
impl<'n> PartialEq for Size<'n>
source§impl<'n> PartialOrd for Size<'n>
impl<'n> PartialOrd for Size<'n>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl<'n> Copy for Size<'n>
impl<'n> Eq for Size<'n>
impl<'n> StructuralPartialEq for Size<'n>
Auto Trait Implementations§
impl<'n> Freeze for Size<'n>
impl<'n> RefUnwindSafe for Size<'n>
impl<'n> Send for Size<'n>
impl<'n> Sync for Size<'n>
impl<'n> Unpin for Size<'n>
impl<'n> UnwindSafe for Size<'n>
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
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<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more