#[non_exhaustive]pub struct EntryPosition {
pub current: NonZeroUsize,
pub total: EntryTotal,
}Expand description
Where an entry sits in the operation: its 1-based number and the total.
§Examples
use exarch_core::EntryPosition;
use exarch_core::EntryTotal;
let position = EntryPosition::at_index(0, EntryTotal::Known(4));
assert_eq!(position.current.get(), 1);
assert_eq!(position.total, EntryTotal::Known(4));Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.current: NonZeroUsizeThe entry’s number, counting from 1.
total: EntryTotalHow many entries the operation holds, when known.
Implementations§
Source§impl EntryPosition
impl EntryPosition
Sourcepub const fn new(current: NonZeroUsize, total: EntryTotal) -> Self
pub const fn new(current: NonZeroUsize, total: EntryTotal) -> Self
Builds a position from its parts.
Sourcepub const fn at_index(index: usize, total: EntryTotal) -> Self
pub const fn at_index(index: usize, total: EntryTotal) -> Self
Builds the position of the entry at the 0-based index.
Trait Implementations§
Source§impl Clone for EntryPosition
impl Clone for EntryPosition
impl Copy for EntryPosition
Source§impl Debug for EntryPosition
impl Debug for EntryPosition
impl Eq for EntryPosition
Source§impl PartialEq for EntryPosition
impl PartialEq for EntryPosition
impl StructuralPartialEq for EntryPosition
Auto Trait Implementations§
impl Freeze for EntryPosition
impl RefUnwindSafe for EntryPosition
impl Send for EntryPosition
impl Sync for EntryPosition
impl Unpin for EntryPosition
impl UnsafeUnpin for EntryPosition
impl UnwindSafe for EntryPosition
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.