Enum debian_packaging::io::ContentDigest
source · pub enum ContentDigest {
Md5(Vec<u8>),
Sha1(Vec<u8>),
Sha256(Vec<u8>),
}Expand description
Represents a content digest.
Variants§
Implementations§
source§impl ContentDigest
impl ContentDigest
sourcepub fn md5_hex(digest: &str) -> Result<Self>
pub fn md5_hex(digest: &str) -> Result<Self>
Create a new MD5 instance by parsing a hex digest.
sourcepub fn sha1_hex(digest: &str) -> Result<Self>
pub fn sha1_hex(digest: &str) -> Result<Self>
Create a new SHA-1 instance by parsing a hex digest.
sourcepub fn sha256_hex(digest: &str) -> Result<Self>
pub fn sha256_hex(digest: &str) -> Result<Self>
Create a new SHA-256 instance by parsing a hex digest.
sourcepub fn from_hex_digest(checksum: ChecksumType, digest: &str) -> Result<Self>
pub fn from_hex_digest(checksum: ChecksumType, digest: &str) -> Result<Self>
Obtain an instance by parsing a hex string as a ChecksumType.
sourcepub fn new_hasher(&self) -> Box<dyn Hasher + Send>
pub fn new_hasher(&self) -> Box<dyn Hasher + Send>
Create a new hasher matching for the type of this digest.
sourcepub fn digest_bytes(&self) -> &[u8] ⓘ
pub fn digest_bytes(&self) -> &[u8] ⓘ
Obtain the digest bytes for this content digest.
sourcepub fn digest_hex(&self) -> String
pub fn digest_hex(&self) -> String
Obtain the hex encoded content digest.
sourcepub fn checksum_type(&self) -> ChecksumType
pub fn checksum_type(&self) -> ChecksumType
Obtain the ChecksumType for this digest.
sourcepub fn release_field_name(&self) -> &'static str
pub fn release_field_name(&self) -> &'static str
Obtain the name of the field in [In]Release files that holds this digest type.
This also corresponds to the directory name for by-hash paths.
Trait Implementations§
source§impl Clone for ContentDigest
impl Clone for ContentDigest
source§fn clone(&self) -> ContentDigest
fn clone(&self) -> ContentDigest
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for ContentDigest
impl Debug for ContentDigest
source§impl PartialEq for ContentDigest
impl PartialEq for ContentDigest
source§fn eq(&self, other: &ContentDigest) -> bool
fn eq(&self, other: &ContentDigest) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd for ContentDigest
impl PartialOrd for ContentDigest
source§fn partial_cmp(&self, other: &ContentDigest) -> Option<Ordering>
fn partial_cmp(&self, other: &ContentDigest) -> Option<Ordering>
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 Eq for ContentDigest
impl StructuralEq for ContentDigest
impl StructuralPartialEq for ContentDigest
Auto Trait Implementations§
impl RefUnwindSafe for ContentDigest
impl Send for ContentDigest
impl Sync for ContentDigest
impl Unpin for ContentDigest
impl UnwindSafe for ContentDigest
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> 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.