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 PartialOrd for Object
impl PartialOrd for Object
source§impl WriteTo for Object
impl WriteTo for Object
Serialization
impl Eq for Object
impl StructuralPartialEq for Object
Auto Trait Implementations§
impl Freeze for Object
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)