pub struct GarbageCollector<S: BlockStore> { /* private fields */ }Expand description
Garbage collector for block storage
Implementations§
Source§impl<S: BlockStore> GarbageCollector<S>
impl<S: BlockStore> GarbageCollector<S>
Sourcepub fn new(
store: Arc<S>,
pin_manager: Arc<PinManager>,
link_resolver: LinkResolver,
config: GcConfig,
) -> Self
pub fn new( store: Arc<S>, pin_manager: Arc<PinManager>, link_resolver: LinkResolver, config: GcConfig, ) -> Self
Create a new garbage collector
§Arguments
store- The block store to collect frompin_manager- Pin manager for determining root blockslink_resolver- Function to get links from a blockconfig- GC configuration
Sourcepub fn new_flat(
store: Arc<S>,
pin_manager: Arc<PinManager>,
config: GcConfig,
) -> Self
pub fn new_flat( store: Arc<S>, pin_manager: Arc<PinManager>, config: GcConfig, ) -> Self
Create with a no-op link resolver (for flat storage without DAG)
Sourcepub fn reset_cancel(&self)
pub fn reset_cancel(&self)
Reset cancel flag
Sourcepub fn stats(&self) -> GcStatsSnapshot
pub fn stats(&self) -> GcStatsSnapshot
Get GC statistics
Auto Trait Implementations§
impl<S> !Freeze for GarbageCollector<S>
impl<S> !RefUnwindSafe for GarbageCollector<S>
impl<S> Send for GarbageCollector<S>
impl<S> Sync for GarbageCollector<S>
impl<S> Unpin for GarbageCollector<S>
impl<S> !UnwindSafe for GarbageCollector<S>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more