pub trait AnyStoredVec: AnyVec {
Show 17 methods
// Required methods
fn db_path(&self) -> PathBuf;
fn region(&self) -> &Region;
fn header(&self) -> &Header;
fn mut_header(&mut self) -> &mut Header;
fn saved_stamped_changes(&self) -> u16;
fn real_stored_len(&self) -> usize;
fn stored_len(&self) -> usize;
fn any_stamped_write_with_changes(&mut self, stamp: Stamp) -> Result<()>;
fn serialize_changes(&self) -> Result<Vec<u8>>;
fn remove(self) -> Result<()>;
fn any_truncate_if_needed_at(&mut self, index: usize) -> Result<()>;
fn any_reset(&mut self) -> Result<()>;
// Provided methods
fn flush(&mut self) -> Result<()> { ... }
fn update_stamp(&mut self, stamp: Stamp) { ... }
fn stamp(&self) -> Stamp { ... }
fn stamped_write(&mut self, stamp: Stamp) -> Result<()> { ... }
fn any_stamped_write_maybe_with_changes(
&mut self,
stamp: Stamp,
with_changes: bool,
) -> Result<()> { ... }
}Expand description
Trait for stored vectors that persist data to disk (as opposed to lazy computed vectors).
Required Methods§
fn db_path(&self) -> PathBuf
fn region(&self) -> &Region
fn header(&self) -> &Header
fn mut_header(&mut self) -> &mut Header
Sourcefn saved_stamped_changes(&self) -> u16
fn saved_stamped_changes(&self) -> u16
Number of stamped change files to keep for rollback support.
Sourcefn real_stored_len(&self) -> usize
fn real_stored_len(&self) -> usize
The actual length stored on disk.
Sourcefn stored_len(&self) -> usize
fn stored_len(&self) -> usize
The effective stored length (may differ from real_stored_len during truncation).
Sourcefn any_stamped_write_with_changes(&mut self, stamp: Stamp) -> Result<()>
fn any_stamped_write_with_changes(&mut self, stamp: Stamp) -> Result<()>
Flushes with the given stamp, saving changes to enable rollback.
Prefixed with any_ to avoid conflict with WritableVec::stamped_write_with_changes.
fn serialize_changes(&self) -> Result<Vec<u8>>
Sourcefn any_truncate_if_needed_at(&mut self, index: usize) -> Result<()>
fn any_truncate_if_needed_at(&mut self, index: usize) -> Result<()>
Truncates the vector to the given length if it is longer.
Prefixed with any_ to avoid conflict with WritableVec::truncate_if_needed_at.
Provided Methods§
fn flush(&mut self) -> Result<()>
fn update_stamp(&mut self, stamp: Stamp)
fn stamp(&self) -> Stamp
fn stamped_write(&mut self, stamp: Stamp) -> Result<()>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".