[−][src]Struct rune::Runtime
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]
&'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,
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]
&mut self,
file_id: usize,
error: VmError
) -> Result<(), VmError>
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]
&mut self,
options: I
) -> Result<(), ConfigurationError> where
I: IntoIterator,
I::Item: AsRef<str>,
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]
O: WriteColor,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,