pub struct Admission<'a, 'buffer, const SLOTS: usize> { /* private fields */ }Expand description
Execution/data lease. Its fields deliberately do not expose raw code addresses or an owned run that could escape the admission borrow.
Implementations§
Source§impl<const SLOTS: usize> Admission<'_, '_, SLOTS>
impl<const SLOTS: usize> Admission<'_, '_, SLOTS>
Sourcepub fn words(&self, handle: Handle) -> Result<&[u32], Error>
pub fn words(&self, handle: Handle) -> Result<&[u32], Error>
Read only through this live admission, never through a cached static view.
Sourcepub fn id(&self, handle: Handle) -> Result<u32, Error>
pub fn id(&self, handle: Handle) -> Result<u32, Error>
Installed logical identity, under the same generation-bound lease.
Sourcepub unsafe fn invoke<R>(
&self,
imports: &mut [StaticImport<'_>],
trap: u32,
caller: impl FnOnce() -> R,
) -> Result<R, Error>
pub unsafe fn invoke<R>( &self, imports: &mut [StaticImport<'_>], trap: u32, caller: impl FnOnce() -> R, ) -> Result<R, Error>
Run a statically typed same-compilation caller while its imports are bound. Trap all sites again and flush I-cache on normal/unwind exit.
§Safety
The closure may call only the exact packaged Rust entries matching the supplied sites/offsets. It must not retain module callbacks or pointers, nor start asynchronous users of module bytes beyond this scope.
Sourcepub unsafe fn invoke_veneered<R>(
&self,
imports: &mut [VeneerImport<'_>],
trap: u32,
caller: impl FnOnce() -> R,
) -> Result<R, Error>
pub unsafe fn invoke_veneered<R>( &self, imports: &mut [VeneerImport<'_>], trap: u32, caller: impl FnOnce() -> R, ) -> Result<R, Error>
Like Admission::invoke, for call sites the packer routed through
resident jump veneers (PackedVeneer). Entering the lease stores each
module entry into its veneer’s target word; leaving it (normal or unwind)
stores the trap back. Nothing is patched and nothing is flushed: the
instruction cache sees only the image install, so a lease costs two data
stores per import instead of a gated cache flush on entry and another on exit.
Every import is validated before any veneer is touched: the module must be admitted, the export inside its executable prefix, the veneer exactly the published code for its address, and its target the trap (a leaked earlier lease is an integrity failure, not a silent rebind).
§Safety
As Admission::invoke: the closure may call only the exact packaged
entries through their typed callers, must not retain module callbacks or
pointers, and must not start asynchronous users of module bytes beyond the scope.