Struct asar::header::FileIntegrity
source · pub struct FileIntegrity { /* private fields */ }
Expand description
This struct contains the integrity details of a file, such as
a hash of the file’s contents, and hashes of “blocks” of the file, which is
split according to the block_size
specified in it.
Implementations§
source§impl FileIntegrity
impl FileIntegrity
sourcepub const fn algorithm(&self) -> HashAlgorithm
pub const fn algorithm(&self) -> HashAlgorithm
The hashing algorithm used to calculate the hash.
Example
println!("This file is hashed using {}", integrity.algorithm());
sourcepub const fn block_size(&self) -> usize
pub const fn block_size(&self) -> usize
The size of each “block” to be hashed in a file.
Defaults to 4 MiB.
Example
println!(
"This file has a block size of {} KiB",
integrity.block_size() / 1024
);
Trait Implementations§
source§impl Clone for FileIntegrity
impl Clone for FileIntegrity
source§fn clone(&self) -> FileIntegrity
fn clone(&self) -> FileIntegrity
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 FileIntegrity
impl Debug for FileIntegrity
source§impl<'de> Deserialize<'de> for FileIntegrity
impl<'de> Deserialize<'de> for FileIntegrity
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Hash for FileIntegrity
impl Hash for FileIntegrity
source§impl PartialEq for FileIntegrity
impl PartialEq for FileIntegrity
source§fn eq(&self, other: &FileIntegrity) -> bool
fn eq(&self, other: &FileIntegrity) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for FileIntegrity
impl Serialize for FileIntegrity
impl Eq for FileIntegrity
impl StructuralEq for FileIntegrity
impl StructuralPartialEq for FileIntegrity
Auto Trait Implementations§
impl RefUnwindSafe for FileIntegrity
impl Send for FileIntegrity
impl Sync for FileIntegrity
impl Unpin for FileIntegrity
impl UnwindSafe for FileIntegrity
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