pub struct EuvPakMapping { /* private fields */ }Expand description
Read-only backing byte mapping for an .euvpak virtual filesystem archive.
Implementations§
Source§impl EuvPakMapping
Cross-platform zero-copy constructors, OS mmap lifecycle, and paging hints for EuvPakMapping.
impl EuvPakMapping
Cross-platform zero-copy constructors, OS mmap lifecycle, and paging hints for EuvPakMapping.
Sourcepub fn from_bytes(bytes: Arc<Vec<u8>>) -> Self
pub fn from_bytes(bytes: Arc<Vec<u8>>) -> Self
Sourcepub fn advise_willneed(&self, offset: usize, len: usize)
pub fn advise_willneed(&self, offset: usize, len: usize)
Advises the OS kernel to prefetch [offset..offset+len] via MADV_WILLNEED when OS-mapped.
§Arguments
usize- Starting byte offset inside the mapping.usize- Byte length to pre-fault sequentially.
Sourcepub fn advise_random(&self, offset: usize, len: usize)
pub fn advise_random(&self, offset: usize, len: usize)
Advises the OS kernel that [offset..offset+len] will be accessed randomly (MADV_RANDOM).
§Arguments
usize- Starting byte offset inside the mapping.usize- Byte length expected to experience random access.
Sourcepub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes(&self) -> &[u8] ⓘ
Returns the mapped archive payload as an immutable zero-copy byte slice.
§Returns
&[u8]- Borrowed view of the mapped.euvpakbytes.
Sourcepub fn base_non_null(&self) -> Option<NonNull<u8>>
pub fn base_non_null(&self) -> Option<NonNull<u8>>
Returns the non-null base pointer of the backing byte buffer on native targets when non-empty.
§Returns
Option<NonNull<u8>>- Non-null pointer to the first byte orNonewhen empty.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true when the mapped archive contains zero bytes.
§Returns
bool- Whether the mapped byte slice is empty.
Sourcepub fn is_os_mapped(&self) -> bool
pub fn is_os_mapped(&self) -> bool
Returns true when backed by an OS virtual memory mapping (mmap / MapViewOfFile).
§Returns
bool- Whether OS virtual memory mapping is active.
Trait Implementations§
Source§impl Clone for EuvPakMapping
impl Clone for EuvPakMapping
Source§impl Debug for EuvPakMapping
impl Debug for EuvPakMapping
Auto Trait Implementations§
impl Forget for EuvPakMapping
impl Freeze for EuvPakMapping
impl Move for EuvPakMapping
impl RefUnwindSafe for EuvPakMapping
impl Send for EuvPakMapping
impl Sync for EuvPakMapping
impl Unpin for EuvPakMapping
impl UnsafeUnpin for EuvPakMappingwhere
*const ArcInner<Vec<u8>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Vec<u8>>>: UnsafeUnpin,
*const ArcInner<EuvPakOsMap> is !null: UnsafeUnpin,
PhantomData<ArcInner<EuvPakOsMap>>: UnsafeUnpin,
impl UnwindSafe for EuvPakMapping
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