#[non_exhaustive]pub enum TreeEntryError {
InvalidName {
name: Vec<u8>,
reason: PathComponentError,
},
NameTooLong {
name: Vec<u8>,
max: usize,
},
InvalidMode {
name: Vec<u8>,
mode: u32,
},
NullObjectId {
name: Vec<u8>,
},
HashAlgoMismatch {
name: Vec<u8>,
expected: HashAlgo,
actual: HashAlgo,
},
DuplicateName {
name: Vec<u8>,
},
}Expand description
Why Objects::write_tree refused an entry.
Each variant carries the offending entry name as raw bytes (tree entry names are not required to be UTF-8).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidName
The name is empty, ., .., a .git alias, or contains / or NUL.
Fields
§
reason: PathComponentErrorWhich path-component rule the name breaks.
NameTooLong
The name is longer than the 4096 bytes git fsck --strict accepts.
InvalidMode
The mode is not one of 100644, 100755, 120000, 40000 or 160000.
NullObjectId
The entry points at the all-zero object id.
HashAlgoMismatch
The entry’s object id uses a different hash algorithm than the repository.
Fields
DuplicateName
Two entries share a name (including a file and a directory of the same name).
Trait Implementations§
Source§impl Clone for TreeEntryError
impl Clone for TreeEntryError
Source§impl Debug for TreeEntryError
impl Debug for TreeEntryError
Source§impl Display for TreeEntryError
impl Display for TreeEntryError
impl Eq for TreeEntryError
Source§impl Error for TreeEntryError
impl Error for TreeEntryError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<TreeEntryError> for Error
impl From<TreeEntryError> for Error
Source§fn from(source: TreeEntryError) -> Self
fn from(source: TreeEntryError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for TreeEntryError
impl PartialEq for TreeEntryError
impl StructuralPartialEq for TreeEntryError
Auto Trait Implementations§
impl Freeze for TreeEntryError
impl RefUnwindSafe for TreeEntryError
impl Send for TreeEntryError
impl Sync for TreeEntryError
impl Unpin for TreeEntryError
impl UnsafeUnpin for TreeEntryError
impl UnwindSafe for TreeEntryError
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