pub struct ObjectId { /* private fields */ }Implementations§
Source§impl ObjectId
impl ObjectId
pub fn from_raw(format: ObjectFormat, raw: &[u8]) -> Result<Self>
pub fn from_hex(format: ObjectFormat, hex: &str) -> Result<Self>
pub const fn format(&self) -> ObjectFormat
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn to_hex(&self) -> String
pub fn write_hex(&self, out: &mut impl Write) -> Result
pub fn hex_prefix_matches(&self, prefix: &[u8]) -> bool
pub const fn abbrev_hex_len(&self, width: usize) -> usize
Sourcepub fn null(format: ObjectFormat) -> Self
pub fn null(format: ObjectFormat) -> Self
The all-zero (“null”) object id for format.
Sourcepub fn empty_tree(format: ObjectFormat) -> Self
pub fn empty_tree(format: ObjectFormat) -> Self
The id of the canonical empty tree for format (4b825dc6… for SHA-1).
Sourcepub fn empty_blob(format: ObjectFormat) -> Self
pub fn empty_blob(format: ObjectFormat) -> Self
The id of the canonical empty blob for format (e69de29b… for SHA-1).
Trait Implementations§
impl Copy for ObjectId
impl Eq for ObjectId
Source§impl Ord for ObjectId
impl Ord for ObjectId
1.21.0 (const: unstable) · Source§fn 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
Source§impl PartialOrd for ObjectId
impl PartialOrd for ObjectId
impl StructuralPartialEq for ObjectId
Auto Trait Implementations§
impl Freeze for ObjectId
impl RefUnwindSafe for ObjectId
impl Send for ObjectId
impl Sync for ObjectId
impl Unpin for ObjectId
impl UnsafeUnpin for ObjectId
impl UnwindSafe for ObjectId
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