[][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 with_default_context() -> Result<Self, ContextError>[src]

Construct a runtime with a default context.

If built with the modules feature, this includes all available native modules.

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

Construct a new runtime with a custom context.

pub fn disable_linking(&mut self)[src]

Disable linking, which will otherwise check that all function signatures exist for all function calls at compile time.

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

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

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

Access the underlying context of the runtime.

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

Get the unit associated with the given file id.

pub fn register_vm_error(
    &mut self,
    top_ip: usize,
    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.

The name of the loaded source will be the path as a string.

pub fn load_source(
    &mut self,
    name: String,
    source: String
) -> Result<usize, LoadError>
[src]

Load the given source and return a number corresponding to its file id.

Use the provided name when generating diagnostics to reference the file.

pub fn emit_diagnostics<O>(
    &mut self,
    out: &mut O
) -> Result<(), DiagnosticsError> 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>,