Struct git_repository::easy::ObjectRef [−][src]
pub struct ObjectRef<'repo, A> {
pub id: ObjectId,
pub kind: Kind,
pub data: Ref<'repo, [u8]>,
// some fields omitted
}
Expand description
A decoded object with a reference to its owning repository.
Limitations
Note that it holds a reference to a buffer of it’s associated repository handle, so there can only be one at a time, per handle.
Fields
id: ObjectId
The id of the object
kind: Kind
The kind of the object
data: Ref<'repo, [u8]>
The fully decoded object data
Implementations
Follow tags to their target and commits to trees until the given kind
of object is encountered.
Note that this object doesn’t necessarily have to be the end of the chain.
Typical values are Kind::Commit
or Kind::Tree
.
Follow all tag object targets until a commit, tree or blob is reached.
Note that this method is different from peel_to_kind(…)
as it won’t
peel commits to their tree, but handles tags only.
Create an owned instance of this object, copying our data in the process.
Turn this instance into an owned one, copying our data in the process.
Obtain a fully parsed commit whose fields reference our data buffer,
Panic
- this object is not a commit
- the commit could not be decoded
Obtain a fully parsed commit whose fields reference our data buffer.
Obtain a commit token iterator from the data in this instance, if it is a commit.
Obtain a tag object from the data in this instance.
Panic
- this object is not a tag
- the tag could not be decoded
Obtain a fully parsed tag object whose fields reference our data buffer.
Trait Implementations
Auto Trait Implementations
impl<'repo, A> !RefUnwindSafe for ObjectRef<'repo, A>
impl<'repo, A> !UnwindSafe for ObjectRef<'repo, A>
Blanket Implementations
Mutably borrows from an owned value. Read more