pub struct EnforcePolicy {
pub allow_rewrite: bool,
pub timeout: Duration,
}Expand description
What an adapter is allowed to do while enforcing a lockfile on this pass.
The two things that used to be hardcoded per adapter, and were wrong in both places:
every adapter burned the compiled-in timeout regardless of command_timeout_secs,
and only cargo and go consulted allow_manifest_rewrite.
Fields§
§allow_rewrite: boolWhether a sync command that writes files Git tracks may run anyway.
The user’s allow_manifest_rewrite. Off by default: a prune pass can come from
the scheduler, and a background process that leaves a dirty working tree behind
is a surprise no matter which file it wrote.
timeout: DurationCeiling on any one package-manager command — the user’s command_timeout_secs.
Implementations§
Source§impl EnforcePolicy
impl EnforcePolicy
Sourcepub fn from_settings(settings: &Settings) -> Self
pub fn from_settings(settings: &Settings) -> Self
A policy from the user’s own settings.
Trait Implementations§
Source§impl Clone for EnforcePolicy
impl Clone for EnforcePolicy
Source§fn clone(&self) -> EnforcePolicy
fn clone(&self) -> EnforcePolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for EnforcePolicy
Source§impl Debug for EnforcePolicy
impl Debug for EnforcePolicy
Auto Trait Implementations§
impl Freeze for EnforcePolicy
impl RefUnwindSafe for EnforcePolicy
impl Send for EnforcePolicy
impl Sync for EnforcePolicy
impl Unpin for EnforcePolicy
impl UnsafeUnpin for EnforcePolicy
impl UnwindSafe for EnforcePolicy
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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