Struct FastContext

Source
pub struct FastContext(/* private fields */);
Expand description

快速路径上下文。

将陷入处理器上下文中在快速路径中可安全操作的部分暴露给快速路径函数。

Implementations§

Source§

impl FastContext

Source

pub fn a0(&self) -> usize

访问陷入上下文的 a0 寄存器。

由于 a0 寄存器在快速路径中用于传递上下文指针, 将陷入上下文的 a0 暂存到陷入处理器上下文中。

Source

pub fn regs(&mut self) -> &mut FlowContext

获取控制流上下文。

Source

pub fn swap_context( &mut self, new: NonNull<FlowContext>, ) -> NonNull<FlowContext>

交换上下文指针。

Source

pub fn call(self, argc: usize) -> FastResult

启动一个带有 argc 个参数的新上下文。

Source

pub fn restore(self) -> FastResult

从快速路径恢复。

NOTICE 必须先手工调用 save_args,或通过其他方式设置参数寄存器。

Source

pub fn switch_to(self, others: NonNull<FlowContext>) -> FastResult

丢弃当前上下文,并直接切换到另一个上下文。

Source

pub fn continue_with<T: 'static>(self, f: EntireHandler<T>, t: T) -> FastResult

向完整路径 f 传递对象 t

NOTICE 必须先手工调用 save_args,或通过其他方式设置参数寄存器。

Auto Trait Implementations§

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> 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, 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.