Struct git2::Oid [−][src]
#[repr(C)]pub struct Oid { /* fields omitted */ }
Expand description
Unique identity of any object (commit, tree, blob, tag).
Implementations
impl Oid[src]
impl Oid[src]pub fn from_str(s: &str) -> Result<Oid, Error>[src]
pub fn from_str(s: &str) -> Result<Oid, Error>[src]Parse a hex-formatted object id into an Oid structure.
Errors
Returns an error if the string is empty, is longer than 40 hex characters, or contains any non-hex characters.
pub fn from_bytes(bytes: &[u8]) -> Result<Oid, Error>[src]
pub fn from_bytes(bytes: &[u8]) -> Result<Oid, Error>[src]Parse a raw object id into an Oid structure.
If the array given is not 20 bytes in length, an error is returned.
pub fn hash_object(kind: ObjectType, bytes: &[u8]) -> Result<Oid, Error>[src]
pub fn hash_object(kind: ObjectType, bytes: &[u8]) -> Result<Oid, Error>[src]Hashes the provided data as an object of the provided type, and returns an Oid corresponding to the result. This does not store the object inside any object database or repository.
pub fn hash_file<P: AsRef<Path>>(
kind: ObjectType,
path: P
) -> Result<Oid, Error>[src]
pub fn hash_file<P: AsRef<Path>>(
kind: ObjectType,
path: P
) -> Result<Oid, Error>[src]Hashes the content of the provided file as an object of the provided type, and returns an Oid corresponding to the result. This does not store the object inside any object database or repository.
Trait Implementations
impl Ord for Oid[src]
impl Ord for Oid[src]impl PartialOrd<Oid> for Oid[src]
impl PartialOrd<Oid> for Oid[src]fn partial_cmp(&self, other: &Oid) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &Oid) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Copy for Oid[src]
impl Eq for Oid[src]
Auto Trait Implementations
impl RefUnwindSafe for Oid
impl Send for Oid
impl Sync for Oid
impl Unpin for Oid
impl UnwindSafe for Oid
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more