euv_core/runtime/vfs/mapping/struct.rs
1use super::*;
2
3/// RAII wrapper owning a read-only OS virtual memory mapping (`mmap` on Unix, `MapViewOfFile` on Windows).
4#[cfg(any(unix, windows))]
5#[derive(Debug)]
6pub(crate) struct EuvPakOsMap {
7 /// Non-null base address of the read-only OS virtual memory mapping.
8 pub(crate) ptr: NonNull<u8>,
9 /// Mapped byte length (always strictly positive).
10 pub(crate) len: usize,
11 /// Win32 file-mapping kernel handle closed alongside unmapping on drop.
12 #[cfg(windows)]
13 pub(crate) mapping_handle: *mut c_void,
14}
15
16/// Read-only backing byte mapping for an `.euvpak` virtual filesystem archive.
17#[derive(Clone, Debug)]
18pub struct EuvPakMapping {
19 /// Shared immutable heap buffer or OS virtual memory map.
20 pub(crate) backing: EuvPakBacking,
21}