Trait forest_filecoin::db::GarbageCollectable
source · pub trait GarbageCollectable<T> {
// Required methods
fn get_keys(&self) -> Result<T>;
fn remove_keys(&self, keys: T) -> Result<u32>;
}
Expand description
A trait to facilitate mark-and-sweep garbage collection.
NOTE: Since there is no real need for generics here right now - the ‘key’ type is specified to avoid wrapping it.
Required Methods§
sourcefn get_keys(&self) -> Result<T>
fn get_keys(&self) -> Result<T>
Gets all the keys currently in the database.
NOTE: This might need to be further enhanced with some sort of limit to avoid taking up too much time and memory.
sourcefn remove_keys(&self, keys: T) -> Result<u32>
fn remove_keys(&self, keys: T) -> Result<u32>
Removes all the keys marked for deletion.
§Arguments
keys
- A set of keys to be removed from the database.