pub enum ReplacePolicy<'a> {
NoClobber,
Recorded {
mode: &'a str,
},
UserConfirmed,
}Expand description
What the caller is authorized to destroy at the target.
This is an enum rather than a bool so that adding it to sync_skill breaks
every call site and forces each one to state its intent — the property worth
having in a fix for silent data loss (issue #363).
Variants§
NoClobber
Only proceed when nothing of the user’s can be lost. Anything we cannot prove is ours is refused.
Recorded
The caller found a skill_targets row claiming exactly this path.
The row is historical intent, not proof of what is on disk now, so it
only authorizes removing an object whose current type matches the
recorded mode: a row saying symlink must never authorize deleting a
real directory that replaced our link.
UserConfirmed
Explicit user intent: adopt an existing directory into the library,
--force, or “update this copy from center”.
Trait Implementations§
Source§impl<'a> Clone for ReplacePolicy<'a>
impl<'a> Clone for ReplacePolicy<'a>
impl<'a> Copy for ReplacePolicy<'a>
Auto Trait Implementations§
impl<'a> Forget for ReplacePolicy<'a>
impl<'a> Freeze for ReplacePolicy<'a>
impl<'a> Move for ReplacePolicy<'a>
impl<'a> RefUnwindSafe for ReplacePolicy<'a>
impl<'a> Send for ReplacePolicy<'a>
impl<'a> Sync for ReplacePolicy<'a>
impl<'a> Unpin for ReplacePolicy<'a>
impl<'a> UnsafeUnpin for ReplacePolicy<'a>where
&'a str: UnsafeUnpin,
impl<'a> UnwindSafe for ReplacePolicy<'a>where
&'a str: UnwindSafe,
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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.