Enum gix_object::Object
source · pub enum Object {
Tree(Tree),
Blob(Blob),
Commit(Commit),
Tag(Tag),
}
Expand description
Mutable objects with each field being separately allocated and changeable.
Mutable objects are Commits, Trees, Blobs and Tags that can be changed and serialized.
They either created using object construction or by deserializing existing objects and converting these into mutable copies for adjustments.
Variants§
Implementations§
source§impl Object
impl Object
Convenient extraction of typed object.
sourcepub fn into_commit(self) -> Commit
pub fn into_commit(self) -> Commit
Turns this instance into a Commit
panic otherwise.
sourcepub fn try_into_blob(self) -> Result<Blob, Self>
pub fn try_into_blob(self) -> Result<Blob, Self>
Turns this instance into a Blob
if it is one.
sourcepub fn try_into_blob_ref(&self) -> Option<BlobRef<'_>>
pub fn try_into_blob_ref(&self) -> Option<BlobRef<'_>>
Turns this instance into a BlobRef
if it is a blob.
sourcepub fn try_into_commit(self) -> Result<Commit, Self>
pub fn try_into_commit(self) -> Result<Commit, Self>
Turns this instance into a Commit
if it is one.
sourcepub fn try_into_tree(self) -> Result<Tree, Self>
pub fn try_into_tree(self) -> Result<Tree, Self>
Turns this instance into a Tree
if it is one.
sourcepub fn try_into_tag(self) -> Result<Tag, Self>
pub fn try_into_tag(self) -> Result<Tag, Self>
Turns this instance into a Tag
if it is one.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Object
impl<'de> Deserialize<'de> for Object
source§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
source§impl Ord for Object
impl Ord for Object
source§impl PartialEq for Object
impl PartialEq for Object
source§impl PartialOrd for Object
impl PartialOrd for Object
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl WriteTo for Object
impl WriteTo for Object
Serialization
impl Eq for Object
impl StructuralPartialEq for Object
Auto Trait Implementations§
impl RefUnwindSafe for Object
impl Send for Object
impl Sync for Object
impl Unpin for Object
impl UnwindSafe for Object
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