#[repr(C)]pub struct GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,{ /* private fields */ }
Expand description
A struct that computes gitoids based on the selected algorithm
Implementations§
source§impl<H, O> GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
impl<H, O> GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
sourcepub fn id_bytes<B: AsRef<[u8]>>(content: B) -> GitOid<H, O>
pub fn id_bytes<B: AsRef<[u8]>>(content: B) -> GitOid<H, O>
Create a new GitOid
based on a slice of bytes.
sourcepub fn id_reader<R: Read + Seek>(reader: R) -> Result<GitOid<H, O>, Error>
pub fn id_reader<R: Read + Seek>(reader: R) -> Result<GitOid<H, O>, Error>
Create a GitOid
from a reader.
sourcepub fn id_reader_with_length<R: Read>(
reader: R,
expected_length: usize
) -> Result<GitOid<H, O>, Error>
pub fn id_reader_with_length<R: Read>( reader: R, expected_length: usize ) -> Result<GitOid<H, O>, Error>
Generate a GitOid
from a reader, providing an expected length in bytes.
sourcepub async fn id_async_reader<R: AsyncRead + AsyncSeek + Unpin>(
reader: R
) -> Result<GitOid<H, O>, Error>
pub async fn id_async_reader<R: AsyncRead + AsyncSeek + Unpin>( reader: R ) -> Result<GitOid<H, O>, Error>
Generate a GitOid
from an asynchronous reader.
sourcepub async fn id_async_reader_with_length<R: AsyncRead + Unpin>(
reader: R,
expected_length: usize
) -> Result<GitOid<H, O>, Error>
pub async fn id_async_reader_with_length<R: AsyncRead + Unpin>( reader: R, expected_length: usize ) -> Result<GitOid<H, O>, Error>
Generate a GitOid
from an asynchronous reader, providing an expected length in bytes.
sourcepub fn try_from_url(url: Url) -> Result<GitOid<H, O>, Error>
pub fn try_from_url(url: Url) -> Result<GitOid<H, O>, Error>
Construct a new GitOid
from a Url
.
sourcepub const fn hash_algorithm(&self) -> &'static str
pub const fn hash_algorithm(&self) -> &'static str
Get the hash algorithm used for the GitOid
.
sourcepub const fn object_type(&self) -> &'static str
pub const fn object_type(&self) -> &'static str
Get the object type of the GitOid
.
Trait Implementations§
source§impl<H, O> Clone for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
impl<H, O> Clone for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
source§impl<H, O> Debug for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
impl<H, O> Debug for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
source§impl<'de, H, O> Deserialize<'de> for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
impl<'de, H, O> Deserialize<'de> for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
source§fn deserialize<D>(deserializer: D) -> StdResult<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> StdResult<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<H, O> Display for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
impl<H, O> Display for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
source§impl<H, O> FromStr for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
impl<H, O> FromStr for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
source§impl<H, O> Hash for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
impl<H, O> Hash for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
source§impl<H, O> Ord for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
impl<H, O> Ord for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
source§impl<H, O> PartialEq for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
impl<H, O> PartialEq for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
source§impl<H, O> PartialOrd for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
impl<H, O> PartialOrd for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
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 moresource§impl<H, O> Serialize for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
impl<H, O> Serialize for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
source§impl<H, O> TryFrom<Url> for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
impl<H, O> TryFrom<Url> for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
impl<H, O> Copy for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
impl<H, O> Eq for GitOid<H, O>where
H: HashAlgorithm,
O: ObjectType,
Auto Trait Implementations§
impl<H, O> RefUnwindSafe for GitOid<H, O>
impl<H, O> Send for GitOid<H, O>
impl<H, O> Sync for GitOid<H, O>
impl<H, O> Unpin for GitOid<H, O>
impl<H, O> UnwindSafe for GitOid<H, O>
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