pub struct InMemoryEditor { /* private fields */ }Expand description
Mutable v1 file facade implemented by loading frames and rewriting the file on save.
FWOB v1 stores frames as a flat sorted array. Deletes require compaction in the original C# implementation; this editor performs the same logical operation by rewriting the file. That is acceptable for compatibility and for the rare bulk-deletion workflow that v2 is designed around.
Implementations§
Source§impl InMemoryEditor
impl InMemoryEditor
pub fn open(path: impl AsRef<Path>, key_field_index: usize) -> Result<Self>
pub fn new(schema: Schema, title: impl Into<String>) -> Result<Self>
pub fn schema(&self) -> &Schema
pub fn title(&self) -> &str
pub fn frame_count(&self) -> u64
pub fn string_table(&self) -> &[String]
pub fn frames(&self) -> &[OwnedFrame]
pub fn append_string(&mut self, value: impl Into<String>) -> u32
pub fn append_frame(&mut self, bytes: &[u8]) -> Result<()>
pub fn append_frames<I, B>(&mut self, frames: I) -> Result<()>
pub fn delete_all_frames(&mut self) -> u64
pub fn delete_frames_before(&mut self, last_key: Key) -> Result<u64>
pub fn delete_frames_after(&mut self, first_key: Key) -> Result<u64>
pub fn delete_frames_between( &mut self, first_key: Key, last_key: Key, ) -> Result<u64>
pub fn delete_frames<I>(&mut self, keys: I) -> Result<u64>where
I: IntoIterator<Item = Key>,
pub fn save_as(&self, path: impl AsRef<Path>) -> Result<()>
Auto Trait Implementations§
impl Freeze for InMemoryEditor
impl RefUnwindSafe for InMemoryEditor
impl Send for InMemoryEditor
impl Sync for InMemoryEditor
impl Unpin for InMemoryEditor
impl UnsafeUnpin for InMemoryEditor
impl UnwindSafe for InMemoryEditor
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