pub struct Chunk<'a> { /* private fields */ }Expand description
Refers to a chunk of memory that was allocated by the bump allocator.
See Stats.
Implementations§
Source§impl<'a> Chunk<'a>
impl<'a> Chunk<'a>
Sourcepub fn iter_prev(self) -> ChunkPrevIter<'a> ⓘ
pub fn iter_prev(self) -> ChunkPrevIter<'a> ⓘ
Returns an iterator over all previous (smaller) chunks.
Sourcepub fn iter_next(self) -> ChunkNextIter<'a> ⓘ
pub fn iter_next(self) -> ChunkNextIter<'a> ⓘ
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§
Source§impl<'a, const GUARANTEED_ALLOCATED: bool> From<Chunk<'a>> for Stats<'a, GUARANTEED_ALLOCATED>
impl<'a, const GUARANTEED_ALLOCATED: bool> From<Chunk<'a>> for Stats<'a, GUARANTEED_ALLOCATED>
impl<'a> Copy for Chunk<'a>
impl<'a> Eq for Chunk<'a>
impl<'a> StructuralPartialEq for Chunk<'a>
Auto Trait Implementations§
impl<'a> Freeze for Chunk<'a>
impl<'a> !RefUnwindSafe for Chunk<'a>
impl<'a> !Send for Chunk<'a>
impl<'a> !Sync for Chunk<'a>
impl<'a> Unpin for Chunk<'a>
impl<'a> !UnwindSafe for Chunk<'a>
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