Skip to main content

Step

Enum Step 

Source
pub enum Step {
    PluginInternal {
        pid: PluginId,
        pi: PluginInternal,
    },
    HostCall {
        hc: HostCall,
        auth: Authorized,
        result: HostResult,
    },
    KernelInternal {
        op: KernelOp,
    },
    MemFree {
        caller: PluginId,
        addr: MemAddr,
    },
    CapRevoke {
        caller: PluginId,
        cap_id: CapId,
    },
}
Expand description

Step represents a single state transition in the Lion microkernel.

Variants§

§

PluginInternal

Plugin-internal computation (untrusted, sandboxed)

Fields

§pid: PluginId

The plugin performing computation

§pi: PluginInternal

The internal computation descriptor

§

HostCall

Host call (trust boundary, mediated)

Fields

§hc: HostCall

The host call request

§auth: Authorized

Authorization witness (validated at execution)

§result: HostResult

Result of host call execution

§

KernelInternal

Kernel-internal operation (trusted TCB)

Fields

§op: KernelOp

The kernel operation to execute

§

MemFree

Direct memory free operation (refinement bridge)

Fields

§caller: PluginId

The plugin requesting the free

§addr: MemAddr

The address to free

§

CapRevoke

Direct capability revoke operation (refinement bridge)

Fields

§caller: PluginId

The plugin requesting revocation

§cap_id: CapId

The capability ID to revoke

Implementations§

Source§

impl Step

Source

pub fn host_call_atomic( state: &State, hc: HostCall, cap_id: CapId, ctx: PolicyContext, result: HostResult, ) -> Result<Self, StepError>

Create a host call step with ATOMIC authorization.

The action is derived from the HostCall via hc.required_action(), binding authorization to the exact operation being performed. This prevents the vulnerability where a valid Authorized token for one action could be reused to execute a different HostCall.

Source

pub fn is_effectful(&self) -> bool

Check if this step is effectful (crosses trust boundary).

Source

pub fn subject(&self) -> Option<PluginId>

Get the subject (executing plugin) of the step, if any.

Source

pub fn level(&self, state: &State) -> SecurityLevel

Get the security level of the step.

Source

pub fn is_declassify(&self) -> bool

Check if this is a declassify operation.

Source

pub fn execute(&self, state: &State) -> Result<State, StepError>

Execute this step, returning the new state.

Source

pub fn execute_mut(&self, state: &mut State) -> Result<(), StepError>

Mutating execution – modifies state in place (production path).

Equivalent to execute but avoids the full-state clone by mutating in place. The validation logic is identical.

Trait Implementations§

Source§

impl Clone for Step

Source§

fn clone(&self) -> Step

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Step

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Step

§

impl RefUnwindSafe for Step

§

impl Send for Step

§

impl Sync for Step

§

impl Unpin for Step

§

impl UnsafeUnpin for Step

§

impl UnwindSafe for Step

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.