pub struct BoxFileReader { /* private fields */ }
Implementations§
Source§impl BoxFileReader
impl BoxFileReader
Sourcepub fn open_at_offset<P: AsRef<Path>>(
path: P,
offset: u64,
) -> Result<BoxFileReader, OpenError>
pub fn open_at_offset<P: AsRef<Path>>( path: P, offset: u64, ) -> Result<BoxFileReader, OpenError>
This will open an existing .box
file for reading and writing, and error if the file is not valid.
Sourcepub fn open<P: AsRef<Path>>(path: P) -> Result<BoxFileReader, OpenError>
pub fn open<P: AsRef<Path>>(path: P) -> Result<BoxFileReader, OpenError>
This will open an existing .box
file for reading and writing, and error if the file is not valid.
pub fn path(&self) -> &Path
pub fn alignment(&self) -> u64
pub fn version(&self) -> u32
pub fn metadata(&self) -> &BoxMetadata
pub fn decompress_value<V: Decompress>(&self, record: &FileRecord) -> Result<V>
pub fn decompress<W: Write>(&self, record: &FileRecord, dest: W) -> Result<()>
pub fn find(&self, path: &BoxPath) -> Result<&Record, ExtractError>
pub fn extract<P: AsRef<Path>>( &self, path: &BoxPath, output_path: P, ) -> Result<(), ExtractError>
pub fn extract_recursive<P: AsRef<Path>>( &self, path: &BoxPath, output_path: P, ) -> Result<(), ExtractError>
pub fn extract_all<P: AsRef<Path>>( &self, output_path: P, ) -> Result<(), ExtractError>
pub fn resolve_link(&self, link: &LinkRecord) -> Result<RecordsItem<'_>>
pub fn read_bytes(&self, record: &FileRecord) -> Result<Take<File>>
Sourcepub unsafe fn memory_map(&self, record: &FileRecord) -> Result<Mmap>
pub unsafe fn memory_map(&self, record: &FileRecord) -> Result<Mmap>
§Safety
Use of memory maps is unsafe as modifications to the file could affect the operation of the application. Ensure that the Box being operated on is not mutated while a memory map is in use.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BoxFileReader
impl RefUnwindSafe for BoxFileReader
impl Send for BoxFileReader
impl Sync for BoxFileReader
impl Unpin for BoxFileReader
impl UnwindSafe for BoxFileReader
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