pub struct Value<E> { /* private fields */ }Implementations§
Source§impl<E: Fixed> Value<E>
impl<E: Fixed> Value<E>
pub unsafe fn open( mode: OpenMode, file: File, max_margin: u64, ) -> Result<Self, OpenError>
pub fn len(&self) -> u64
pub fn last_id(&self) -> u64
pub fn is_empty(&self) -> bool
pub fn last_entry_id(&self) -> Option<u64>
pub unsafe fn buf_unchecked(&self, id: u64) -> BufConst<E>
pub unsafe fn buf_mut_unchecked(&mut self, id: u64) -> BufMut<E>
pub fn last_buf(&self) -> Option<BufConst<E>>
pub fn is_id_valid(&self, id: u64) -> bool
pub fn buf(&self, id: u64) -> BufConst<E>
pub fn buf_mut(&mut self, id: u64) -> BufMut<E>
pub fn add(&mut self, entry: impl Readable<E>) -> Result<u64, AddError>
pub fn remove_last(&mut self) -> Result<(), RemoveLastError>
pub fn remove_if_last(&mut self, id: u64) -> Result<bool, RemoveLastError>
pub fn all_ids(&self) -> impl Iterator<Item = u64>
pub unsafe fn copy(&mut self, src_id: u64, dst_id: u64)
pub unsafe fn swap(&mut self, a_id: u64, b_id: u64)
Sourcepub unsafe fn swap_remove(&mut self, id: u64) -> Result<(), SwapRemoveError>
pub unsafe fn swap_remove(&mut self, id: u64) -> Result<(), SwapRemoveError>
Swaps given entry with the last entry and removes it. WARNING: This method changes ID of the last entry in this collection. You probably should only use this if this collection is used as a stack/set and not as a map. Doesn’t check if id is valid.
pub fn set(&mut self, id: u64, value: impl Readable<E>)
Auto Trait Implementations§
impl<E> Freeze for Value<E>
impl<E> RefUnwindSafe for Value<E>
impl<E> Send for Value<E>
impl<E> Sync for Value<E>
impl<E> Unpin for Value<E>
impl<E> UnwindSafe for Value<E>
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