pub struct Tree<'a> { /* private fields */ }Expand description
A structurally valid tree, including Git ordering and unique byte names. Validation uses constant storage. File/directory aliases can be separated by other names in Git order, so checking them may reread earlier entries. Every read, including these rescans, consumes an encoded-byte work budget.
Implementations§
Source§impl<'a> Tree<'a>
impl<'a> Tree<'a>
Sourcepub fn parse(data: &'a [u8]) -> Result<Self>
pub fn parse(data: &'a [u8]) -> Result<Self>
Validate using a 64 MiB encoded-byte work budget. Hosts importing multiple trees can share a different budget through parse_with_budget.
pub fn parse_with_format(data: &'a [u8], format: ObjectFormat) -> Result<Self>
Sourcepub fn parse_with_budget(data: &'a [u8], budget: &mut u64) -> Result<Self>
pub fn parse_with_budget(data: &'a [u8], budget: &mut u64) -> Result<Self>
Charge encoded bytes read, including duplicate-name rescans, against a caller-owned budget. LimitExceeded stops before reading beyond it. Budget already spent is retained on error; the tree remains borrowed/immutable.
pub fn parse_with_budget_and_format( data: &'a [u8], budget: &mut u64, format: ObjectFormat, ) -> Result<Self>
pub fn entries(&self) -> TreeEntries<'a> ⓘ
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Tree<'a>
impl<'a> RefUnwindSafe for Tree<'a>
impl<'a> Send for Tree<'a>
impl<'a> Sync for Tree<'a>
impl<'a> Unpin for Tree<'a>
impl<'a> UnsafeUnpin for Tree<'a>
impl<'a> UnwindSafe for Tree<'a>
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