Struct git_object::Data
source · [−]Expand description
A borrowed object using a slice as backing buffer, or in other words a bytes buffer that knows the kind of object it represents.
Fields
kind: Kind
kind of object
data: &'a [u8]
decoded, decompressed data, owned by a backing store.
Implementations
Constructs a new data object from kind
and data
.
Decodes the data in the backing slice into a ObjectRef
, allowing to access all of its data
conveniently. The cost of parsing an object is negligible.
Note that mutable, decoded objects can be created from Data
using crate::ObjectRef::into_owned()
.
Returns this object as tree iterator to parse entries one at a time to avoid allocations, or
None
if this is not a tree object.
Returns this object as commit iterator to parse tokens one at a time to avoid allocations, or
None
if this is not a commit object.
Returns this object as tag iterator to parse tokens one at a time to avoid allocations, or
None
if this is not a tag object.
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl<'a> RefUnwindSafe for Data<'a>
impl<'a> UnwindSafe for Data<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more