Struct cargo::core::global_cache_tracker::DeferredGlobalLastUse
source · pub struct DeferredGlobalLastUse { /* private fields */ }
Expand description
This is a cache of modifications that will be saved to disk all at once
via the DeferredGlobalLastUse::save
method.
This is here to improve performance.
Implementations§
source§impl DeferredGlobalLastUse
impl DeferredGlobalLastUse
pub fn new() -> DeferredGlobalLastUse
pub fn is_empty(&self) -> bool
sourcepub fn mark_registry_index_used(&mut self, registry_index: RegistryIndex)
pub fn mark_registry_index_used(&mut self, registry_index: RegistryIndex)
Indicates the given RegistryIndex
has been used right now.
sourcepub fn mark_registry_crate_used(&mut self, registry_crate: RegistryCrate)
pub fn mark_registry_crate_used(&mut self, registry_crate: RegistryCrate)
Indicates the given RegistryCrate
has been used right now.
Also implicitly marks the index used, too.
sourcepub fn mark_registry_src_used(&mut self, registry_src: RegistrySrc)
pub fn mark_registry_src_used(&mut self, registry_src: RegistrySrc)
Indicates the given RegistrySrc
has been used right now.
Also implicitly marks the index used, too.
sourcepub fn mark_git_checkout_used(&mut self, git_checkout: GitCheckout)
pub fn mark_git_checkout_used(&mut self, git_checkout: GitCheckout)
Indicates the given GitCheckout
has been used right now.
Also implicitly marks the git db used, too.
sourcepub fn mark_registry_index_used_stamp(
&mut self,
registry_index: RegistryIndex,
timestamp: Option<&SystemTime>
)
pub fn mark_registry_index_used_stamp( &mut self, registry_index: RegistryIndex, timestamp: Option<&SystemTime> )
Indicates the given RegistryIndex
has been used with the given
time (or “now” if None
).
sourcepub fn mark_registry_crate_used_stamp(
&mut self,
registry_crate: RegistryCrate,
timestamp: Option<&SystemTime>
)
pub fn mark_registry_crate_used_stamp( &mut self, registry_crate: RegistryCrate, timestamp: Option<&SystemTime> )
Indicates the given RegistryCrate
has been used with the given
time (or “now” if None
).
Also implicitly marks the index used, too.
sourcepub fn mark_registry_src_used_stamp(
&mut self,
registry_src: RegistrySrc,
timestamp: Option<&SystemTime>
)
pub fn mark_registry_src_used_stamp( &mut self, registry_src: RegistrySrc, timestamp: Option<&SystemTime> )
Indicates the given RegistrySrc
has been used with the given
time (or “now” if None
).
Also implicitly marks the index used, too.
sourcepub fn mark_git_checkout_used_stamp(
&mut self,
git_checkout: GitCheckout,
timestamp: Option<&SystemTime>
)
pub fn mark_git_checkout_used_stamp( &mut self, git_checkout: GitCheckout, timestamp: Option<&SystemTime> )
Indicates the given GitCheckout
has been used with the given
time (or “now” if None
).
Also implicitly marks the git db used, too.
sourcepub fn save(&mut self, tracker: &mut GlobalCacheTracker) -> CargoResult<()>
pub fn save(&mut self, tracker: &mut GlobalCacheTracker) -> CargoResult<()>
Saves all of the deferred information to the database.
This will also clear the state of self
.
sourcepub fn save_no_error(&mut self, gctx: &GlobalContext)
pub fn save_no_error(&mut self, gctx: &GlobalContext)
Variant of DeferredGlobalLastUse::save
that does not return an
error.
This will log or display a warning to the user.