Struct sqlx_oldapi::types::git2::Oid
source · #[repr(C)]pub struct Oid { /* private fields */ }Expand description
Unique identity of any object (commit, tree, blob, tag).
Implementations§
source§impl Oid
impl Oid
sourcepub fn from_str(s: &str) -> Result<Oid, Error>
pub fn from_str(s: &str) -> Result<Oid, Error>
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.
sourcepub fn from_bytes(bytes: &[u8]) -> Result<Oid, Error>
pub 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.
sourcepub fn hash_object(kind: ObjectType, bytes: &[u8]) -> Result<Oid, Error>
pub fn hash_object(kind: ObjectType, bytes: &[u8]) -> Result<Oid, Error>
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.
Trait Implementations§
source§impl<'q, DB> Encode<'q, DB> for Oid
impl<'q, DB> Encode<'q, DB> for Oid
source§fn encode_by_ref(
&self,
buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer
) -> IsNull
fn encode_by_ref( &self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer ) -> IsNull
source§fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNullwhere
Self: Sized,
fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNullwhere
Self: Sized,
Writes the value of
self into buf in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
fn size_hint(&self) -> usize
source§impl Ord for Oid
impl Ord for Oid
source§impl PartialEq for Oid
impl PartialEq for Oid
source§impl PartialOrd for Oid
impl PartialOrd for Oid
1.0.0 · source§fn 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 moreimpl Copy for Oid
impl Eq for Oid
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§
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.source§impl<T> ToHex for T
impl<T> ToHex for T
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Lower case
letters are used (e.g. f9b4ca)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Upper case
letters are used (e.g. F9B4CA)