pub struct MiraCallContext<'a> { /* private fields */ }Expand description
Capabilities available to a native callback during one VM execution.
The context cannot outlive the callback invocation.
Implementations§
Source§impl MiraCallContext<'_>
impl MiraCallContext<'_>
Sourcepub fn call(&mut self, function: &MiraAny, args: &[MiraAny]) -> Result<MiraAny>
pub fn call(&mut self, function: &MiraAny, args: &[MiraAny]) -> Result<MiraAny>
Call a native, script, or callable extern value.
Sourcepub fn get(
&mut self,
value: &MiraAny,
key: impl Into<MiraAny>,
) -> Result<MiraAny>
pub fn get( &mut self, value: &MiraAny, key: impl Into<MiraAny>, ) -> Result<MiraAny>
Read a field or index using the same rules as a MiraScript expression.
Sourcepub fn options(&self) -> &RunOptions
pub fn options(&self) -> &RunOptions
Return the options for the current execution.
Sourcepub fn checkpoint(&mut self) -> Result<()>
pub fn checkpoint(&mut self) -> Result<()>
Cooperatively check the current execution’s timeout.
Long-running native callbacks should call this method periodically.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for MiraCallContext<'a>
impl<'a> !Send for MiraCallContext<'a>
impl<'a> !Sync for MiraCallContext<'a>
impl<'a> !UnwindSafe for MiraCallContext<'a>
impl<'a> Freeze for MiraCallContext<'a>
impl<'a> Unpin for MiraCallContext<'a>
impl<'a> UnsafeUnpin for MiraCallContext<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more