[−][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 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]
&mut self,
top_ip: usize,
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.
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]
&mut self,
name: String,
source: String
) -> Result<usize, LoadError>
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]
&mut self,
out: &mut O
) -> Result<(), DiagnosticsError> where
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>,