pub struct Vecx<T> { /* private fields */ }Expand description
A disk-based, Vec-like data structure with typed values.
Vecx stores a sequence of values on disk, encoding them for persistence.
Implementations§
Source§impl<T: ValueEnDe> Vecx<T>
impl<T: ValueEnDe> Vecx<T>
Sourcepub unsafe fn shadow(&self) -> Self
pub unsafe fn shadow(&self) -> Self
Creates a “shadow” copy of the Vecx instance.
§Safety
This API breaks Rust’s semantic safety guarantees. Use only in a race-free environment.
Sourcepub unsafe fn from_bytes(s: impl AsRef<[u8]>) -> Self
pub unsafe fn from_bytes(s: impl AsRef<[u8]>) -> Self
Creates a Vecx from a byte slice.
§Safety
This function is unsafe and assumes the byte slice is a valid representation.
Sourcepub fn get_mut(&mut self, idx: usize) -> Option<ValueMut<'_, T>>
pub fn get_mut(&mut self, idx: usize) -> Option<ValueMut<'_, T>>
Retrieves a mutable reference to a value at a specific index.
Sourcepub fn swap_remove(&mut self, idx: usize) -> T
pub fn swap_remove(&mut self, idx: usize) -> T
Removes a value at a specific index and returns it, replacing it with the last value.
§Panics
Panics if idx is out of bounds.
Sourcepub fn iter_mut(&mut self) -> VecxIterMut<'_, T> ⓘ
pub fn iter_mut(&mut self) -> VecxIterMut<'_, T> ⓘ
Returns a mutable iterator over the vector’s values.
Sourcepub fn is_the_same_instance(&self, other_hdr: &Self) -> bool
pub fn is_the_same_instance(&self, other_hdr: &Self) -> bool
Checks if this Vecx instance is the same as another.
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Vecx<T>
impl<'de, T> Deserialize<'de> for Vecx<T>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<T: Eq> Eq for Vecx<T>
impl<T> StructuralPartialEq for Vecx<T>
Auto Trait Implementations§
impl<T> !Freeze for Vecx<T>
impl<T> RefUnwindSafe for Vecx<T>where
T: RefUnwindSafe,
impl<T> Send for Vecx<T>where
T: Send,
impl<T> Sync for Vecx<T>where
T: Sync,
impl<T> Unpin for Vecx<T>where
T: Unpin,
impl<T> UnwindSafe for Vecx<T>where
T: UnwindSafe,
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.