pub struct Shard<'map, T, const BLOCK_SIZE: u64> { /* private fields */ }Implementations§
Source§impl<'storage, T: Default, const BLOCK_SIZE: u64> Shard<'storage, T, BLOCK_SIZE>
impl<'storage, T: Default, const BLOCK_SIZE: u64> Shard<'storage, T, BLOCK_SIZE>
Sourcepub fn insert(
&mut self,
key: u64,
value: T,
) -> Result<&'storage mut T, BlockFull>
pub fn insert( &mut self, key: u64, value: T, ) -> Result<&'storage mut T, BlockFull>
Inserts the supplied key-value pair. If the block is already full, then returns an error. Panics if the supplied key falls outside of the range of the current shard or if its less than or equal to the last key supplied.
Sourcepub fn finish(&mut self)
pub fn finish(&mut self)
Consume the remainder of the space allocated to this writer. This needs to be called prior
returning the shard to the VecWriter.
pub fn is_empty(&self) -> bool
Auto Trait Implementations§
impl<'map, T, const BLOCK_SIZE: u64> Freeze for Shard<'map, T, BLOCK_SIZE>
impl<'map, T, const BLOCK_SIZE: u64> RefUnwindSafe for Shard<'map, T, BLOCK_SIZE>where
T: RefUnwindSafe,
impl<'map, T, const BLOCK_SIZE: u64> Send for Shard<'map, T, BLOCK_SIZE>where
T: Send,
impl<'map, T, const BLOCK_SIZE: u64> Sync for Shard<'map, T, BLOCK_SIZE>where
T: Sync,
impl<'map, T, const BLOCK_SIZE: u64> Unpin for Shard<'map, T, BLOCK_SIZE>
impl<'map, T, const BLOCK_SIZE: u64> !UnwindSafe for Shard<'map, T, BLOCK_SIZE>
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