Struct bump_scope::Chunk
source · pub struct Chunk<'a, const UP: bool> { /* private fields */ }
Expand description
Refers to a chunk of memory that was allocated by the bump allocator.
See Stats
/ GuaranteedAllocatedStats
.
Implementations§
source§impl<'a, const UP: bool> Chunk<'a, UP>
impl<'a, const UP: bool> Chunk<'a, UP>
sourcepub fn iter_prev(self) -> ChunkPrevIter<'a, UP> ⓘ
pub fn iter_prev(self) -> ChunkPrevIter<'a, UP> ⓘ
Returns an iterator over all previous (smaller) chunks.
sourcepub fn iter_next(self) -> ChunkNextIter<'a, UP> ⓘ
pub fn iter_next(self) -> ChunkNextIter<'a, UP> ⓘ
Returns an iterator over all next (bigger) chunks.
sourcepub fn allocated(self) -> usize
pub fn allocated(self) -> usize
Returns the amount of allocated bytes. This includes padding and wasted space due to reallocations.
sourcepub fn chunk_start(self) -> NonNull<u8>
pub fn chunk_start(self) -> NonNull<u8>
Returns a pointer to the start of the chunk.
sourcepub fn content_start(self) -> NonNull<u8>
pub fn content_start(self) -> NonNull<u8>
Returns a pointer to the start of the chunk’s content.
sourcepub fn content_end(self) -> NonNull<u8>
pub fn content_end(self) -> NonNull<u8>
Returns a pointer to the end of the chunk’s content.
sourcepub fn bump_position(self) -> NonNull<u8>
pub fn bump_position(self) -> NonNull<u8>
Returns the bump pointer. It lies within the chunk’s content range.
Trait Implementations§
impl<'a, const UP: bool> Copy for Chunk<'a, UP>
impl<'a, const UP: bool> Eq for Chunk<'a, UP>
impl<'a, const UP: bool> StructuralPartialEq for Chunk<'a, UP>
Auto Trait Implementations§
impl<'a, const UP: bool> Freeze for Chunk<'a, UP>
impl<'a, const UP: bool> !RefUnwindSafe for Chunk<'a, UP>
impl<'a, const UP: bool> !Send for Chunk<'a, UP>
impl<'a, const UP: bool> !Sync for Chunk<'a, UP>
impl<'a, const UP: bool> Unpin for Chunk<'a, UP>
impl<'a, const UP: bool> !UnwindSafe for Chunk<'a, UP>
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
)