pub struct MemoryMappedArchive { /* private fields */ }Available on crate feature
mmap only.Expand description
Cross-platform memory-mapped file wrapper with security boundaries
Implementations§
Source§impl MemoryMappedArchive
impl MemoryMappedArchive
Sourcepub fn new<P: AsRef<Path>>(
path: P,
config: MemoryMapConfig,
security_limits: SecurityLimits,
session_tracker: Arc<SessionTracker>,
) -> Result<Self>
pub fn new<P: AsRef<Path>>( path: P, config: MemoryMapConfig, security_limits: SecurityLimits, session_tracker: Arc<SessionTracker>, ) -> Result<Self>
Create a new memory-mapped archive from a file
Sourcepub fn from_file(
file: File,
config: MemoryMapConfig,
security_limits: SecurityLimits,
session_tracker: Arc<SessionTracker>,
) -> Result<Self>
pub fn from_file( file: File, config: MemoryMapConfig, security_limits: SecurityLimits, session_tracker: Arc<SessionTracker>, ) -> Result<Self>
Create a memory-mapped archive from an existing file handle
Sourcepub fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<()>
pub fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<()>
Safely read data from memory mapping with bounds checking
Sourcepub fn get_slice(&self, offset: u64, len: usize) -> Result<&[u8]>
pub fn get_slice(&self, offset: u64, len: usize) -> Result<&[u8]>
Get a safe slice from memory mapping with bounds checking
Sourcepub fn stats(&self) -> &MemoryMapStats
pub fn stats(&self) -> &MemoryMapStats
Get memory mapping statistics
Sourcepub fn is_healthy(&self) -> bool
pub fn is_healthy(&self) -> bool
Check if memory mapping is active and healthy
Trait Implementations§
Source§impl Debug for MemoryMappedArchive
impl Debug for MemoryMappedArchive
Auto Trait Implementations§
impl Freeze for MemoryMappedArchive
impl RefUnwindSafe for MemoryMappedArchive
impl Send for MemoryMappedArchive
impl Sync for MemoryMappedArchive
impl Unpin for MemoryMappedArchive
impl UnwindSafe for MemoryMappedArchive
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> 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