Struct extendr_api::prelude::utils::constrained::IdxInclusive
#[repr(transparent)]pub struct IdxInclusive<'n, I>(Branded<'n, I>);
Expand description
I
value smaller or equal to the size corresponding to the lifetime 'n
.
Tuple Fields§
§0: Branded<'n, I>
Implementations§
§impl<'n> IdxInclusive<'n, usize>
impl<'n> IdxInclusive<'n, usize>
pub fn range_to(self, last: IdxInclusive<'n, usize>) -> impl DoubleEndedIterator
pub fn range_to(self, last: IdxInclusive<'n, usize>) -> impl DoubleEndedIterator
Returns an iterator over constrained indices from 0
to self
(exclusive).
§impl<'n, I> IdxInclusive<'n, I>where
I: Index,
impl<'n, I> IdxInclusive<'n, I>where
I: Index,
pub fn new_checked(idx: I, size: Size<'n>) -> IdxInclusive<'n, I>
pub fn new_checked(idx: I, size: Size<'n>) -> IdxInclusive<'n, I>
Returns a constrained inclusive index after checking that it’s bounded (inclusively) by
size
.
pub unsafe fn new_unchecked(idx: I, size: Size<'n>) -> IdxInclusive<'n, I>
pub unsafe fn new_unchecked(idx: I, size: Size<'n>) -> IdxInclusive<'n, I>
Returns a constrained inclusive index, assuming that it’s bounded (inclusively) by
size
.
pub unsafe fn new_raw_unchecked(idx: I) -> IdxInclusive<'n, I>
pub unsafe fn new_raw_unchecked(idx: I) -> IdxInclusive<'n, I>
Returns a constrained inclusive index, assuming that it’s bounded (inclusively) by
the size tied to 'n
.
pub fn into_inner(self) -> I
pub fn into_inner(self) -> I
Returns the unconstrained value.
Trait Implementations§
§impl<'n, I> Clone for IdxInclusive<'n, I>where
I: Clone,
impl<'n, I> Clone for IdxInclusive<'n, I>where
I: Clone,
§fn clone(&self) -> IdxInclusive<'n, I>
fn clone(&self) -> IdxInclusive<'n, I>
Returns a copy 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 more§impl<I> Debug for IdxInclusive<'_, I>where
I: Debug,
impl<I> Debug for IdxInclusive<'_, I>where
I: Debug,
§impl<I> Deref for IdxInclusive<'_, I>
impl<I> Deref for IdxInclusive<'_, I>
§impl<'n, I> Ord for IdxInclusive<'n, I>where
I: Ord,
impl<'n, I> Ord for IdxInclusive<'n, I>where
I: Ord,
§fn cmp(&self, other: &IdxInclusive<'n, I>) -> Ordering
fn cmp(&self, other: &IdxInclusive<'n, I>) -> 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
§impl<'n, I> PartialEq for IdxInclusive<'n, I>where
I: PartialEq,
impl<'n, I> PartialEq for IdxInclusive<'n, I>where
I: PartialEq,
§impl<'n, I> PartialOrd for IdxInclusive<'n, I>where
I: PartialOrd,
impl<'n, I> PartialOrd for IdxInclusive<'n, I>where
I: PartialOrd,
impl<'n, I> Copy for IdxInclusive<'n, I>where
I: Copy,
impl<'n, I> Eq for IdxInclusive<'n, I>where
I: Eq,
impl<'n, I> StructuralPartialEq for IdxInclusive<'n, I>
Auto Trait Implementations§
impl<'n, I> Freeze for IdxInclusive<'n, I>where
I: Freeze,
impl<'n, I> RefUnwindSafe for IdxInclusive<'n, I>where
I: RefUnwindSafe,
impl<'n, I> Send for IdxInclusive<'n, I>where
I: Send,
impl<'n, I> Sync for IdxInclusive<'n, I>where
I: Sync,
impl<'n, I> Unpin for IdxInclusive<'n, I>where
I: Unpin,
impl<'n, I> UnwindSafe for IdxInclusive<'n, I>where
I: UnwindSafe,
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§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