pub struct DigestValue { /* private fields */ }Implementations§
Source§impl DigestValue
impl DigestValue
pub fn from_raw_standard( raw: impl Into<Vec<u8>>, standard: impl Into<String>, ) -> Self
pub fn from_raw_hex(raw: impl Into<Vec<u8>>) -> Self
pub fn from_hex(hex: impl AsRef<str>) -> Result<Self, FromHexError>
pub fn raw(&self) -> &[u8] ⓘ
pub fn into_raw(self) -> Vec<u8> ⓘ
Sourcepub fn standard(&self) -> &str
pub fn standard(&self) -> &str
Examples found in repository?
More examples
examples/hash_file.rs (line 12)
5fn main() -> Result<(), Box<dyn std::error::Error>> {
6 let path = env::args()
7 .nth(1)
8 .expect("usage: cargo run -p hashjunkie --example hash_file -- PATH");
9 let result = hash_file(path, &[Algorithm::Blake3, Algorithm::Sha256])?;
10
11 for (algorithm, digest) in &result {
12 println!("{algorithm}: {}", digest.standard());
13 }
14
15 Ok(())
16}pub fn hex(&self) -> String
Trait Implementations§
Source§impl Clone for DigestValue
impl Clone for DigestValue
Source§fn clone(&self) -> DigestValue
fn clone(&self) -> DigestValue
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 DigestValue
impl Debug for DigestValue
Source§impl PartialEq for DigestValue
impl PartialEq for DigestValue
impl Eq for DigestValue
impl StructuralPartialEq for DigestValue
Auto Trait Implementations§
impl Freeze for DigestValue
impl RefUnwindSafe for DigestValue
impl Send for DigestValue
impl Sync for DigestValue
impl Unpin for DigestValue
impl UnsafeUnpin for DigestValue
impl UnwindSafe for DigestValue
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more