pub enum RefreshPolicy {
UseCache,
Update,
}Expand description
Whether a source that is already in the cache may be advanced from the network.
The distinction exists because “resolve” is asked for by two callers that
want opposite things. Boot and rebuild want what the user already has —
deterministic, offline-capable, no per-start network round trip. The
update verb exists precisely to go and get something newer, and is the
only caller that should.
A pinned rev ignores this entirely: a pin is the answer to “which
commit”, so there is nothing for either policy to decide. Both will still
fetch-and-move when the checkout is not at the pin (the user edited the pin
in init.rs), and neither touches the network when it already is.
Variants§
UseCache
Use the checkout on disk as it stands. No network for a repository that is already cloned.
Update
Fetch and move an unpinned checkout to the tracked head.
Trait Implementations§
Source§impl Clone for RefreshPolicy
impl Clone for RefreshPolicy
Source§fn clone(&self) -> RefreshPolicy
fn clone(&self) -> RefreshPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RefreshPolicy
Source§impl Debug for RefreshPolicy
impl Debug for RefreshPolicy
Source§impl Default for RefreshPolicy
impl Default for RefreshPolicy
Source§fn default() -> RefreshPolicy
fn default() -> RefreshPolicy
impl Eq for RefreshPolicy
Source§impl PartialEq for RefreshPolicy
impl PartialEq for RefreshPolicy
impl StructuralPartialEq for RefreshPolicy
Auto Trait Implementations§
impl Freeze for RefreshPolicy
impl RefUnwindSafe for RefreshPolicy
impl Send for RefreshPolicy
impl Sync for RefreshPolicy
impl Unpin for RefreshPolicy
impl UnsafeUnpin for RefreshPolicy
impl UnwindSafe for RefreshPolicy
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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