pub struct ArchiveReader { /* private fields */ }Expand description
Reader for CASC archive files with memory mapping support
Implementations§
Source§impl ArchiveReader
impl ArchiveReader
Sourcepub fn can_memory_map(size: u64) -> bool
pub fn can_memory_map(size: u64) -> bool
Determine if we can memory map a file of this size
Sourcepub fn reader_at(
&self,
offset: u64,
length: usize,
) -> Result<ArchiveSection<'_>>
pub fn reader_at( &self, offset: u64, length: usize, ) -> Result<ArchiveSection<'_>>
Create a reader at a specific offset for streaming access (zero-copy when possible)
Sourcepub fn read_at_cow(&self, offset: u64, length: usize) -> Result<Cow<'_, [u8]>>
pub fn read_at_cow(&self, offset: u64, length: usize) -> Result<Cow<'_, [u8]>>
Read data at a specific offset (returns Cow for zero-copy when possible)
Sourcepub fn read_at(&mut self, offset: u64, length: usize) -> Result<Vec<u8>>
pub fn read_at(&mut self, offset: u64, length: usize) -> Result<Vec<u8>>
Read data at a specific offset (allocates for compatibility)
Sourcepub fn read_slice(&self, offset: u64, length: usize) -> Result<&[u8]>
pub fn read_slice(&self, offset: u64, length: usize) -> Result<&[u8]>
Read a slice of data without allocation (only works with mmap)
Sourcepub fn is_memory_mapped(&self) -> bool
pub fn is_memory_mapped(&self) -> bool
Check if memory mapping is available
Auto Trait Implementations§
impl Freeze for ArchiveReader
impl RefUnwindSafe for ArchiveReader
impl Send for ArchiveReader
impl Sync for ArchiveReader
impl Unpin for ArchiveReader
impl UnwindSafe for ArchiveReader
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