pub struct TreeEntry { /* private fields */ }Implementations§
Source§impl TreeEntry
impl TreeEntry
Sourcepub fn with_raw_git_mode(self, mode: RawGitMode) -> Result<TreeEntry, TreeError>
pub fn with_raw_git_mode(self, mode: RawGitMode) -> Result<TreeEntry, TreeError>
Record the mode this entry had in its source Git tree. A mode Git would
write anyway is not recorded, so a canonical entry stays byte-identical
to one built without a source mode. Errors when mode does not read as
this entry’s kind and executable bit.
Sourcepub fn raw_git_mode(&self) -> Option<RawGitMode>
pub fn raw_git_mode(&self) -> Option<RawGitMode>
The recorded source Git mode, present only when it is not canonical.
Sourcepub fn same_meaning(&self, other: &TreeEntry) -> bool
pub fn same_meaning(&self, other: &TreeEntry) -> bool
Whether two entries mean the same thing: same name, kind, executable
bit and target. Ignores the recorded source Git mode, which only
affects export. Merge and other semantic comparisons use this; ==
compares the encoded entry.
Sourcepub fn git_mode(&self) -> Option<RawGitMode>
pub fn git_mode(&self) -> Option<RawGitMode>
The mode to write for this entry in a Git tree: the recorded source
mode, else the canonical one. None for a spoollink.
pub fn file( name: impl Into<String>, hash: ContentHash, executable: bool, ) -> Result<TreeEntry, TreeError>
pub fn directory( name: impl Into<String>, hash: ContentHash, ) -> Result<TreeEntry, TreeError>
pub fn symlink( name: impl Into<String>, hash: ContentHash, ) -> Result<TreeEntry, TreeError>
pub fn gitlink( name: impl Into<String>, target: ObjectId, ) -> Result<TreeEntry, TreeError>
Sourcepub fn spoollink(
name: impl Into<String>,
spool_id: SpoolId,
state_id: StateId,
) -> Result<TreeEntry, TreeError>
pub fn spoollink( name: impl Into<String>, spool_id: SpoolId, state_id: StateId, ) -> Result<TreeEntry, TreeError>
Build a native child-spool edge: a pointer to spool_id anchored at
state_id. Not a git submodule (see TreeEntryTarget::Spoollink).
pub fn name(&self) -> &str
pub fn set_name(&mut self, name: impl Into<String>) -> Result<(), TreeError>
pub fn with_mode(&self, mode: FileMode) -> Result<TreeEntry, TreeError>
pub fn target(&self) -> &TreeEntryTarget
pub fn entry_type(&self) -> EntryType
pub fn mode(&self) -> FileMode
pub fn content_hash(&self) -> Option<ContentHash>
pub fn leaf_content_hash(&self) -> Option<ContentHash>
pub fn require_content_hash(&self) -> ContentHash
pub fn blob_hash(&self) -> Option<ContentHash>
pub fn tree_hash(&self) -> Option<ContentHash>
pub fn symlink_hash(&self) -> Option<ContentHash>
pub fn gitlink_target(&self) -> Option<ObjectId>
Sourcepub fn spoollink_target(&self) -> Option<(&SpoolId, StateId)>
pub fn spoollink_target(&self) -> Option<(&SpoolId, StateId)>
The (spool_id, state_id) pointer for a spoollink entry, else None.
pub fn is_tree(&self) -> bool
pub fn is_blob(&self) -> bool
pub fn is_symlink(&self) -> bool
pub fn is_gitlink(&self) -> bool
pub fn is_spoollink(&self) -> bool
pub fn is_executable(&self) -> bool
Sourcepub fn decoded_size(&self) -> usize
pub fn decoded_size(&self) -> usize
Owned name-plus-target bytes used by streaming page budgets.