pub struct AsarFile<'a> { /* private fields */ }
Expand description
This represents a file in an asar archive, with a byte slice referencing the contents, and the integrity details containing file hashes.
Implementations§
source§impl<'a> AsarFile<'a>
impl<'a> AsarFile<'a>
sourcepub fn data(&self) -> &[u8] ⓘ
pub fn data(&self) -> &[u8] ⓘ
The data of the file.
Example
use asar::AsarReader;
use std::path::Path;
let file_info = asar.read(Path::new("hello.txt")).unwrap();
assert_eq!(file_info.data(), b"Hello, World!");
sourcepub const fn integrity(&self) -> Option<&FileIntegrity>
pub const fn integrity(&self) -> Option<&FileIntegrity>
Integrity details of the file, such as hashes.
Example
use asar::AsarReader;
use std::path::Path;
let file_info = asar.read(Path::new("hello.txt")).unwrap();
let integrity = file_info.integrity().unwrap();
assert_eq!(
integrity.hash(),
b"\xf6\x95\x2d\x6e\xef\x55\x5d\xdd\x87\xac\xa6\x6e\x56\xb9\x15\x30\x22\
x2d\x6e\x31\x84\x14\x81\x6f\x3b\xa7\xcf\x5b\xf6\x94\xbf\x0f"
);
Trait Implementations§
source§impl<'a> PartialEq for AsarFile<'a>
impl<'a> PartialEq for AsarFile<'a>
impl<'a> Eq for AsarFile<'a>
impl<'a> StructuralEq for AsarFile<'a>
impl<'a> StructuralPartialEq for AsarFile<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for AsarFile<'a>
impl<'a> Send for AsarFile<'a>
impl<'a> Sync for AsarFile<'a>
impl<'a> Unpin for AsarFile<'a>
impl<'a> UnwindSafe for AsarFile<'a>
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