Struct fencryption_lib::file_header::FileHeader
source · pub struct FileHeader { /* private fields */ }Expand description
Manipulate (create/parse) file headers.
A pack file header is made up of 12 bytes:
- 4 bytes representing the length of the associated path
- 8 bytes representing the length of the associated file
The maximum file length that can be stored in the header is about 18.4 Terabytes.
Implementations
sourceimpl FileHeader
impl FileHeader
sourcepub fn new<P1, P2>(file_path: P1, dir_path: P2) -> Result<FileHeader, ErrorKind>where
P1: AsRef<Path>,
P2: AsRef<Path>,
pub fn new<P1, P2>(file_path: P1, dir_path: P2) -> Result<FileHeader, ErrorKind>where
P1: AsRef<Path>,
P2: AsRef<Path>,
Creates a pack file header.
sourcepub fn to_vec(&self) -> Result<Vec<u8>, ErrorKind>
pub fn to_vec(&self) -> Result<Vec<u8>, ErrorKind>
Returns the current header as a vector of bytes
pub fn path_len_usize(&self) -> Result<usize, ErrorKind>
pub fn file_len_u64(&self) -> u64
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for FileHeader
impl Send for FileHeader
impl Sync for FileHeader
impl Unpin for FileHeader
impl UnwindSafe for FileHeader
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more