Struct git2::Oid [] [src]

pub struct Oid {
    // some fields omitted
}

Unique identity of any object (commit, tree, blob, tag).

Methods

impl Oid

fn from_str(s: &str) -> Result<Oid, Error>

Parse a hex-formatted object id into an Oid structure.

If the string is not a valid 40-character hex string, an error is returned.

fn from_bytes(bytes: &[u8]) -> Result<Oid, Error>

Parse a raw object id into an Oid structure.

If the array given is not 20 bytes in length, an error is returned.

fn as_bytes(&self) -> &[u8]

View this OID as a byte-slice 20 bytes in length.

fn is_zero(&self) -> bool

Test if this OID is all zeros.

Trait Implementations

impl Debug for Oid

fn fmt(&self, f: &mut Formatter) -> Result

impl Display for Oid

fn fmt(&self, f: &mut Formatter) -> Result

impl PartialEq for Oid

fn eq(&self, other: &Oid) -> bool

fn ne(&self, other: &Rhs) -> bool

impl Eq for Oid

impl PartialOrd for Oid

fn partial_cmp(&self, other: &Oid) -> Option<Ordering>

fn lt(&self, other: &Rhs) -> bool

fn le(&self, other: &Rhs) -> bool

fn gt(&self, other: &Rhs) -> bool

fn ge(&self, other: &Rhs) -> bool

impl Ord for Oid

fn cmp(&self, other: &Oid) -> Ordering

impl Clone for Oid

fn clone(&self) -> Oid

fn clone_from(&mut self, source: &Self)

impl Hash for Oid

fn hash<H: Hasher>(&self, into: &mut H)

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

Derived Implementations

impl Copy for Oid