pub struct Gc<'a, 'gctx> {
gctx: &'gctx GlobalContext,
global_cache_tracker: &'a mut GlobalCacheTracker,
lock: CacheLock<'gctx>,
}
Expand description
Garbage collector.
See the module docs at crate::core::gc
for more information on GC.
Fields§
§gctx: &'gctx GlobalContext
§global_cache_tracker: &'a mut GlobalCacheTracker
§lock: CacheLock<'gctx>
A lock on the package cache.
This is important to be held, since we don’t want multiple cargos to be allowed to write to the cache at the same time, or for others to read while we are modifying the cache.
Implementations§
source§impl<'a, 'gctx> Gc<'a, 'gctx>
impl<'a, 'gctx> Gc<'a, 'gctx>
pub fn new( gctx: &'gctx GlobalContext, global_cache_tracker: &'a mut GlobalCacheTracker, ) -> CargoResult<Gc<'a, 'gctx>>
sourcefn auto(&mut self, clean_ctx: &mut CleanContext<'gctx>) -> CargoResult<()>
fn auto(&mut self, clean_ctx: &mut CleanContext<'gctx>) -> CargoResult<()>
Performs automatic garbage cleaning.
This returns immediately without doing work if garbage collection has
been performed recently (since gc.auto.frequency
).
sourcepub fn gc(
&mut self,
clean_ctx: &mut CleanContext<'gctx>,
gc_opts: &GcOpts,
) -> CargoResult<()>
pub fn gc( &mut self, clean_ctx: &mut CleanContext<'gctx>, gc_opts: &GcOpts, ) -> CargoResult<()>
Performs garbage collection based on the given options.
Auto Trait Implementations§
impl<'a, 'gctx> Freeze for Gc<'a, 'gctx>
impl<'a, 'gctx> !RefUnwindSafe for Gc<'a, 'gctx>
impl<'a, 'gctx> !Send for Gc<'a, 'gctx>
impl<'a, 'gctx> !Sync for Gc<'a, 'gctx>
impl<'a, 'gctx> Unpin for Gc<'a, 'gctx>
impl<'a, 'gctx> !UnwindSafe for Gc<'a, 'gctx>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes