Enum git_object::Object
source · 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
Tree(Tree)
Blob(Blob)
Commit(Commit)
Tag(Tag)
Implementations
sourceimpl 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
sourceimpl<'de> Deserialize<'de> for Object
impl<'de> Deserialize<'de> for Object
sourcefn 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
sourceimpl Ord for Object
impl Ord for Object
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Object> for Object
impl PartialOrd<Object> for Object
sourcefn partial_cmp(&self, other: &Object) -> Option<Ordering>
fn partial_cmp(&self, other: &Object) -> Option<Ordering>
1.0.0 · sourcefn 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 moresourceimpl WriteTo for Object
impl WriteTo for Object
Serialization
impl Eq for Object
impl StructuralEq 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more