pub struct TombstoneRegistry {
pub tombstones: HashMap<u32, Tombstone>,
pub path_to_handle: HashMap<PathBuf, u32>,
pub last_compaction_epoch: u64,
}Expand description
Tombstone registry for managing deleted files
Fields§
§tombstones: HashMap<u32, Tombstone>§path_to_handle: HashMap<PathBuf, u32>§last_compaction_epoch: u64Implementations§
Source§impl TombstoneRegistry
impl TombstoneRegistry
pub fn new() -> Self
Sourcepub fn load_or_create(registry_path: &Path) -> Result<Self>
pub fn load_or_create(registry_path: &Path) -> Result<Self>
Load tombstone registry from file, or create new if doesn’t exist
pub fn read_from_file(path: &Path) -> Result<Self>
pub fn write_to_file(&self, path: &Path) -> Result<()>
Sourcepub fn add_tombstone(&mut self, tombstone: Tombstone)
pub fn add_tombstone(&mut self, tombstone: Tombstone)
Add a tombstone for a deleted file
Sourcepub fn is_tombstoned(&self, file_handle: u32) -> bool
pub fn is_tombstoned(&self, file_handle: u32) -> bool
Check if a file handle is tombstoned (deleted)
Sourcepub fn is_path_tombstoned(&self, path: &Path) -> bool
pub fn is_path_tombstoned(&self, path: &Path) -> bool
Check if a file path is tombstoned (deleted)
Sourcepub fn get_tombstone(&self, file_handle: u32) -> Option<&Tombstone>
pub fn get_tombstone(&self, file_handle: u32) -> Option<&Tombstone>
Get tombstone by file handle
Sourcepub fn get_tombstones_since_epoch(&self, epoch: u64) -> Vec<&Tombstone>
pub fn get_tombstones_since_epoch(&self, epoch: u64) -> Vec<&Tombstone>
Get all tombstones created since a specific epoch
Sourcepub fn compact_tombstones_before_epoch(&mut self, epoch: u64) -> Vec<Tombstone>
pub fn compact_tombstones_before_epoch(&mut self, epoch: u64) -> Vec<Tombstone>
Remove tombstones older than specified epoch (for compaction)
Sourcepub fn stats(&self) -> TombstoneStats
pub fn stats(&self) -> TombstoneStats
Get statistics about tombstones
Trait Implementations§
Source§impl Clone for TombstoneRegistry
impl Clone for TombstoneRegistry
Source§fn clone(&self) -> TombstoneRegistry
fn clone(&self) -> TombstoneRegistry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TombstoneRegistry
impl Debug for TombstoneRegistry
Source§impl<'de> Deserialize<'de> for TombstoneRegistry
impl<'de> Deserialize<'de> for TombstoneRegistry
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
Auto Trait Implementations§
impl Freeze for TombstoneRegistry
impl RefUnwindSafe for TombstoneRegistry
impl Send for TombstoneRegistry
impl Sync for TombstoneRegistry
impl Unpin for TombstoneRegistry
impl UnwindSafe for TombstoneRegistry
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