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) -> Self
pub unsafe fn new_raw_unchecked(n: usize) -> Self
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<Item = Idx<'size, usize>>
pub fn indices(self) -> impl DoubleEndedIterator<Item = Idx<'size, usize>>
Returns an iterator of the indices smaller than self
.
Trait Implementations§
Source§impl<'n> Ord for Size<'n>
impl<'n> Ord for Size<'n>
Source§impl<'n> PartialOrd for Size<'n>
impl<'n> PartialOrd for Size<'n>
impl<'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§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