pub struct Position(/* private fields */);
Expand description
The position of something inside a Chunk
.
It’s a pair of a chunk position and an item index.
Implementations§
Source§impl Position
impl Position
Sourcepub fn new(chunk_identifier: ChunkIdentifier, index: usize) -> Self
pub fn new(chunk_identifier: ChunkIdentifier, index: usize) -> Self
Create a new Position
.
Sourcepub fn chunk_identifier(&self) -> ChunkIdentifier
pub fn chunk_identifier(&self) -> ChunkIdentifier
Get the chunk identifier of the item.
Sourcepub fn decrement_index(&mut self)
pub fn decrement_index(&mut self)
Decrement the index part (see Self::index
), i.e. subtract 1.
§Panic
This method will panic if it will underflow, i.e. if the index is 0.
Sourcepub fn increment_index(&mut self)
pub fn increment_index(&mut self)
Increment the index part (see Self::index
), i.e. add 1.
§Panic
This method will panic if it will overflow, i.e. if the index is larger
than usize::MAX
.
Trait Implementations§
impl Copy for Position
impl StructuralPartialEq for Position
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnwindSafe for Position
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,
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>