pub enum CacheLockMode {
DownloadExclusive,
Shared,
MutateExclusive,
}Expand description
The style of lock to acquire.
Variants§
DownloadExclusive
A DownloadExclusive lock ensures that only one cargo is doing
resolution and downloading new packages.
You should use this when downloading new packages or doing resolution.
If another cargo has a MutateExclusive lock, then an attempt to get
a DownloadExclusive lock will block.
If another cargo has a Shared lock, then both can operate
concurrently.
A Shared lock allows multiple cargos to read from the source files.
You should use this when cargo is reading source files from the
package cache. This is typically done during the build phase, since
cargo only needs to read files during that time. This allows multiple
cargo processes to build concurrently without interfering with one
another, while guarding against other cargos using MutateExclusive.
If another cargo has a MutateExclusive lock, then an attempt to get
a Shared will block.
If another cargo has a DownloadExclusive lock, then they both can
operate concurrently under the assumption that downloading does not
modify existing source files.
MutateExclusive
A MutateExclusive lock ensures no other cargo is reading or writing
from the package caches.
You should use this when modifying existing files in the package
cache. For example, things like garbage collection want to avoid
deleting files while other cargos are trying to read (Shared) or
resolve or download (DownloadExclusive).
If another cargo has a DownloadExclusive or Shared lock, then this
will block until they all release their locks.
Trait Implementations§
Source§impl Clone for CacheLockMode
impl Clone for CacheLockMode
Source§fn clone(&self) -> CacheLockMode
fn clone(&self) -> CacheLockMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CacheLockMode
impl Debug for CacheLockMode
Source§impl PartialEq for CacheLockMode
impl PartialEq for CacheLockMode
impl Copy for CacheLockMode
impl StructuralPartialEq for CacheLockMode
Auto Trait Implementations§
impl Freeze for CacheLockMode
impl RefUnwindSafe for CacheLockMode
impl Send for CacheLockMode
impl Sync for CacheLockMode
impl Unpin for CacheLockMode
impl UnwindSafe for CacheLockMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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,
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: 1 byte
Size for each variant:
DownloadExclusive: 0 bytesShared: 0 bytesMutateExclusive: 0 bytes