pub enum ForeignWhy {
HandWritten,
NotUtf8,
Unreadable {
why: String,
},
MultiplyLinked {
links: u64,
},
}Expand description
Why a file at a hook path is not ours to write.
Every variant is a REASON, carried so the refusal can name it. “not ours” alone sends somebody to look at a file for a difference they cannot see; “not valid UTF-8” tells them it is a compiled hook in one word.
Variants§
HandWritten
Readable text without our marker. Somebody wrote this on purpose.
NotUtf8
Not valid UTF-8 — a compiled binary, or text in another encoding. The
case the old unwrap_or(false) silently overwrote.
Unreadable
It exists and we could not read it. Permissions, a bad mount, a disappearing network share. Never “therefore ours”.
MultiplyLinked
A hard link with other names pointing at the same inode. Truncating it would rewrite whatever else refers to it, and we cannot see from here what that is.
Implementations§
Trait Implementations§
Source§impl Clone for ForeignWhy
impl Clone for ForeignWhy
Source§fn clone(&self) -> ForeignWhy
fn clone(&self) -> ForeignWhy
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 moreSource§impl Debug for ForeignWhy
impl Debug for ForeignWhy
impl Eq for ForeignWhy
Source§impl PartialEq for ForeignWhy
impl PartialEq for ForeignWhy
impl StructuralPartialEq for ForeignWhy
Auto Trait Implementations§
impl Freeze for ForeignWhy
impl RefUnwindSafe for ForeignWhy
impl Send for ForeignWhy
impl Sync for ForeignWhy
impl Unpin for ForeignWhy
impl UnsafeUnpin for ForeignWhy
impl UnwindSafe for ForeignWhy
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