Skip to main content

Invocation

Struct Invocation 

Source
pub struct Invocation<'call, C>
where C: HostSchema,
{ /* private fields */ }
Expand description

Runs scripts while borrowing the application’s current host context.

Provided by Rustia::invoke for the duration of its closure. Host callbacks receive only their allowed context views, without a VM handle that would let them call back into Luau.

Implementations§

Source§

impl<'call, C> Invocation<'call, C>
where C: HostSchema,

Source

pub const fn fuel_remaining(&self) -> u64

Fuel remaining in the budget shared by every guest call in this invocation.

Source

pub fn load<'chunk, 'source, S>( &'chunk mut self, source: &'source S, ) -> InvocationChunk<'chunk, 'call, 'source, C>
where S: AsRef<[u8]> + ?Sized,

Creates a borrowed chunk builder using this invocation’s shared fuel budget and typed host dispatcher.

Source

pub fn install(&mut self, module: &CompiledModule) -> Result<Exports>

Source

pub fn call_entry<Return>(&mut self, entry: &CompiledEntry) -> Result<Return>
where Return: FromRustia,

Executes a precompiled stateless decision body directly.

Unlike install, this does not construct an exports table, retain bytecode in the VM, or return handles that survive the invocation. Host effects and slot writes remain transactional under the surrounding invocation.

Trait Implementations§

Source§

impl<C> Drop for Invocation<'_, C>
where C: HostSchema,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'call, C> Freeze for Invocation<'call, C>

§

impl<'call, C> !RefUnwindSafe for Invocation<'call, C>

§

impl<'call, C> !Send for Invocation<'call, C>

§

impl<'call, C> !Sync for Invocation<'call, C>

§

impl<'call, C> Unpin for Invocation<'call, C>
where <C as HostSchema>::Record: Unpin,

§

impl<'call, C> UnsafeUnpin for Invocation<'call, C>

§

impl<'call, C> !UnwindSafe for Invocation<'call, C>

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.