Skip to main content

InvocationChunk

Struct InvocationChunk 

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

A borrowed source chunk executed through a typed Invocation.

Implementations§

Source§

impl<'chunk, 'call, 'source, C> InvocationChunk<'chunk, 'call, 'source, C>
where C: HostSchema,

Source

pub fn source_name(self, source_name: impl Into<String>) -> Self

Sets the source name used by compile/runtime diagnostics and as the referrer passed to the host module resolver for require calls.

Source

pub fn source_map(self, mapping: SourceMap) -> Self

Maps a generated console prefix out of human-facing diagnostics.

Source

pub fn environment(self, environment: impl Into<Table>) -> Self

Selects the exact rooted lexical environment.

Source

pub fn eval<T>(self) -> Result<T>
where T: FromRustia,

Evaluates and converts the first result through the owned typed facade.

Source

pub fn eval_live(self) -> Result<Value>

Evaluates and retains the first result without snapshotting.

Source

pub fn eval_serde<T>(self) -> Result<T>

Evaluates and deserializes directly from the live VM graph.

Source

pub fn exec(self) -> Result<()>

Executes the chunk for side effects.

Source

pub fn install(self) -> Result<Exports>

Atomically installs the chunk. The result remains provisional until the enclosing typed invocation commits its record transaction.

Trait Implementations§

Source§

impl<C> Debug for InvocationChunk<'_, '_, '_, C>
where C: HostSchema,

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'chunk, 'call, 'source, C> Freeze for InvocationChunk<'chunk, 'call, 'source, C>

§

impl<'chunk, 'call, 'source, C> !RefUnwindSafe for InvocationChunk<'chunk, 'call, 'source, C>

§

impl<'chunk, 'call, 'source, C> !Send for InvocationChunk<'chunk, 'call, 'source, C>

§

impl<'chunk, 'call, 'source, C> !Sync for InvocationChunk<'chunk, 'call, 'source, C>

§

impl<'chunk, 'call, 'source, C> Unpin for InvocationChunk<'chunk, 'call, 'source, C>

§

impl<'chunk, 'call, 'source, C> UnsafeUnpin for InvocationChunk<'chunk, 'call, 'source, C>

§

impl<'chunk, 'call, 'source, C> !UnwindSafe for InvocationChunk<'chunk, 'call, 'source, 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.