pub struct PartIndex(/* private fields */);Available on crate feature
std only.Expand description
A part’s 0-based index within its parent segment.
Implementations§
Source§impl PartIndex
impl PartIndex
Sourcepub const fn checked_next(self) -> Option<PartIndex>
pub const fn checked_next(self) -> Option<PartIndex>
The next value, or None if this is u32::MAX.
Sourcepub const fn wrapping_next(self) -> PartIndex
pub const fn wrapping_next(self) -> PartIndex
The next value, wrapping u32::MAX to 0.
Sourcepub const fn saturating_next(self) -> PartIndex
pub const fn saturating_next(self) -> PartIndex
The next value, saturating at u32::MAX.
Sourcepub const fn checked_add(self, n: u32) -> Option<PartIndex>
pub const fn checked_add(self, n: u32) -> Option<PartIndex>
self + n, or None on overflow.
Sourcepub const fn checked_sub(self, n: u32) -> Option<PartIndex>
pub const fn checked_sub(self, n: u32) -> Option<PartIndex>
self - n, or None on underflow.
Sourcepub const fn checked_distance_from(self, earlier: PartIndex) -> Option<u32>
pub const fn checked_distance_from(self, earlier: PartIndex) -> Option<u32>
The distance self - earlier, or None if earlier > self.
Trait Implementations§
impl Copy for PartIndex
impl Eq for PartIndex
Source§impl Ord for PartIndex
impl Ord for PartIndex
1.21.0 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for PartIndex
impl PartialOrd for PartIndex
impl StructuralPartialEq for PartIndex
Auto Trait Implementations§
impl Freeze for PartIndex
impl RefUnwindSafe for PartIndex
impl Send for PartIndex
impl Sync for PartIndex
impl Unpin for PartIndex
impl UnsafeUnpin for PartIndex
impl UnwindSafe for PartIndex
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