Enum git_object::ObjectRef
source · [−]pub enum ObjectRef<'a> {
Tree(TreeRef<'a>),
Blob(BlobRef<'a>),
Commit(CommitRef<'a>),
Tag(TagRef<'a>),
}
Expand description
Immutable objects are read-only structures referencing most data from a byte slice.
Immutable objects are expected to be deserialized from bytes that acts as backing store, and they
cannot be mutated or serialized. Instead, one will convert them into their mutable
counterparts
which support mutation and serialization.
An ObjectRef
is representing Trees
, Blobs
, Commits
, or Tags
.
Variants
Tree(TreeRef<'a>)
Blob(BlobRef<'a>)
Commit(CommitRef<'a>)
Tag(TagRef<'a>)
Implementations
Deserialize an object from a loose serialisation
Deserialize an object of kind
from the given data
.
Convert the immutable object into a mutable version, consuming the source in the process.
Note that this is an expensive operation.
Convenient access to contained objects.
Interpret this object as commit, chainable.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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
Serialization
Write the contained object to out
in the git serialization format.
Auto Trait Implementations
impl<'a> RefUnwindSafe for ObjectRef<'a>
impl<'a> UnwindSafe for ObjectRef<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more