[][src]Struct rune::Runtime

pub struct Runtime { /* fields omitted */ }

A rune runtime, which simplifies embedding and using rune.

Implementations

impl Runtime[src]

pub fn new() -> Result<Self, ContextError>[src]

Construct a new runtime with the default context.

pub fn has_issues(&self) -> bool[src]

Indicate that the runtime has issues it can report with emit_diagnostics.

pub fn with_context(context: Context) -> Self[src]

Construct a new runtime with a custom context.

pub fn vm(&self) -> &Vm[src]

Access the underlying virtual machine of the runtime.

pub fn context(&self) -> &Context[src]

Access the underlying context of the runtime.

pub fn unit(&self, file_id: usize) -> Option<&CompilationUnit>[src]

Get the unit associated with the given file id.

pub fn call_function<'a, A, T, I>(
    &'a mut self,
    file_id: usize,
    name: I,
    args: A
) -> Result<Task<'a, T>, CallFunctionError> where
    I: IntoIterator,
    I::Item: AsRef<str>,
    A: 'a + IntoArgs,
    T: FromValue
[src]

Call the given function in the given named file.

Returns the associated task and the file id associated with the unit.

pub fn register_vm_error(
    &mut self,
    file_id: usize,
    error: VmError
) -> Result<(), VmError>
[src]

Register the runtime error.

If we don't have debuginfo, returns Err with the passed in error.

pub fn parse_optimization<I>(
    &mut self,
    options: I
) -> Result<(), ConfigurationError> where
    I: IntoIterator,
    I::Item: AsRef<str>, 
[src]

Prase the given optimization options.

pub fn load(&mut self, path: &Path) -> Result<usize, LoadError>[src]

Load the given path into the runtime.

pub fn emit_diagnostics<O>(&mut self, out: &mut O) -> Result<()> where
    O: WriteColor, 
[src]

Emit diagnostics about the last error we encountered.

Auto Trait Implementations

impl !RefUnwindSafe for Runtime

impl !Send for Runtime

impl !Sync for Runtime

impl Unpin for Runtime

impl !UnwindSafe for Runtime

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,