#[non_exhaustive]pub enum ChecksumAlgorithm {
Sha1,
Sha256,
Sha384,
Sha512,
Sha3_256,
Sha3_384,
Sha3_512,
Blake2b256,
Blake2b384,
Blake2b512,
Blake3,
Other(String),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Sha1
Sha256
Sha384
Sha512
Sha3_256
Sha3_384
Sha3_512
Blake2b256
Blake2b384
Blake2b512
Blake3
Other(String)
A value this client does not recognize.
Implementations§
Source§impl ChecksumAlgorithm
impl ChecksumAlgorithm
Sourcepub fn digest_len(&self) -> Option<usize>
pub fn digest_len(&self) -> Option<usize>
Digest size in bytes for algorithms listed in checksum-type.
Sourcepub fn is_weak(&self) -> bool
pub fn is_weak(&self) -> bool
Whether this algorithm is too weak for a match to count as
crate::IntegrityOutcome::Verified on its own.
SHA-1 is listed in the pinned checksum-type enum but is not
collision resistant. MD5 is not in that enum; it is parsed as
Self::Other, never computed, and also reported as weak.
Trait Implementations§
Source§impl Clone for ChecksumAlgorithm
impl Clone for ChecksumAlgorithm
Source§impl Debug for ChecksumAlgorithm
impl Debug for ChecksumAlgorithm
Source§impl<'de> Deserialize<'de> for ChecksumAlgorithm
impl<'de> Deserialize<'de> for ChecksumAlgorithm
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ChecksumAlgorithm
impl Display for ChecksumAlgorithm
impl Eq for ChecksumAlgorithm
Source§impl Hash for ChecksumAlgorithm
impl Hash for ChecksumAlgorithm
Source§impl PartialEq for ChecksumAlgorithm
impl PartialEq for ChecksumAlgorithm
Source§impl Serialize for ChecksumAlgorithm
impl Serialize for ChecksumAlgorithm
impl StructuralPartialEq for ChecksumAlgorithm
Auto Trait Implementations§
impl Forget for ChecksumAlgorithm
impl Freeze for ChecksumAlgorithm
impl RefUnwindSafe for ChecksumAlgorithm
impl Send for ChecksumAlgorithm
impl Sync for ChecksumAlgorithm
impl Unpin for ChecksumAlgorithm
impl UnsafeUnpin for ChecksumAlgorithm
impl UnwindSafe for ChecksumAlgorithm
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