pub enum ChecksumType {
Crc32,
Xxhash,
Sha256,
Blake2,
Unknown(u16),
}Expand description
Checksum algorithm used by the filesystem, stored in the superblock’s
csum_type field.
Variants§
Crc32
CRC32C (Castagnoli), the default and most common checksum algorithm.
Xxhash
xxHash64, a fast non-cryptographic hash.
Sha256
SHA-256, a cryptographic hash.
Blake2
BLAKE2b-256, a cryptographic hash.
Unknown(u16)
Unrecognized checksum type value.
Implementations§
Source§impl ChecksumType
impl ChecksumType
Sourcepub fn from_raw(val: u16) -> ChecksumType
pub fn from_raw(val: u16) -> ChecksumType
Parse from the raw on-disk u16 value.
Sourcepub fn compute(self, data: &[u8]) -> Vec<u8> ⓘ
pub fn compute(self, data: &[u8]) -> Vec<u8> ⓘ
Compute the checksum of data. The returned vector has length
Self::size. Panics on ChecksumType::Unknown because there’s
no algorithm to dispatch to.
§Panics
Panics if invoked on ChecksumType::Unknown.
Trait Implementations§
Source§impl Clone for ChecksumType
impl Clone for ChecksumType
Source§fn clone(&self) -> ChecksumType
fn clone(&self) -> ChecksumType
Returns a duplicate 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 ChecksumType
impl Debug for ChecksumType
Source§impl Display for ChecksumType
impl Display for ChecksumType
Source§impl PartialEq for ChecksumType
impl PartialEq for ChecksumType
impl Copy for ChecksumType
impl Eq for ChecksumType
impl StructuralPartialEq for ChecksumType
Auto Trait Implementations§
impl Freeze for ChecksumType
impl RefUnwindSafe for ChecksumType
impl Send for ChecksumType
impl Sync for ChecksumType
impl Unpin for ChecksumType
impl UnsafeUnpin for ChecksumType
impl UnwindSafe for ChecksumType
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