Skip to main content
← PSoXide SDK guides and examples · SDK 80d1c329e977 · All Cargo features enabled; check feature gates before use.

Admission

Struct Admission 

Source
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>

Source

pub fn words(&self, handle: Handle) -> Result<&[u32], Error>

Read only through this live admission, never through a cached static view.

Source

pub fn id(&self, handle: Handle) -> Result<u32, Error>

Installed logical identity, under the same generation-bound lease.

Source

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.

Source

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.

Auto Trait Implementations§

§

impl<'a, 'buffer, const SLOTS: usize> Freeze for Admission<'a, 'buffer, SLOTS>

§

impl<'a, 'buffer, const SLOTS: usize> RefUnwindSafe for Admission<'a, 'buffer, SLOTS>

§

impl<'a, 'buffer, const SLOTS: usize> Send for Admission<'a, 'buffer, SLOTS>

§

impl<'a, 'buffer, const SLOTS: usize> Sync for Admission<'a, 'buffer, SLOTS>

§

impl<'a, 'buffer, const SLOTS: usize> Unpin for Admission<'a, 'buffer, SLOTS>

§

impl<'a, 'buffer, const SLOTS: usize> UnsafeUnpin for Admission<'a, 'buffer, SLOTS>

§

impl<'a, 'buffer, const SLOTS: usize> !UnwindSafe for Admission<'a, 'buffer, SLOTS>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.