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>
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>
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>
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§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>
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
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