[][src]Struct glsp::Runtime

pub struct Runtime(_);

The GameLisp interpreter.

Runtime owns all of the data required to run GameLisp code: a set of global variables, a symbol table, a set of registered Rust functions, and much more.

To manipulate the GameLisp runtime, you don't call methods on the Runtime type directly. Instead, use the run method to establish a particular Runtime as the "active runtime", then use this crate's global functions and methods to interact with the active runtime.

If you attempt to execute any GameLisp-related code without an active runtime, it will almost always panic.

It's possible for multiple Runtimes to coexist. Each runtime is strictly isolated from the others - they don't share global variables, symbols, and so on. This means that it's possible to run GameLisp code in isolated Runtimes on multiple threads without needing any synchronization.

Implementations

impl Runtime[src]

pub fn new() -> Runtime[src]

Construct a Runtime with default settings.

To construct a custom Runtime, use RuntimeBuilder instead.

pub fn run<F, R>(&self, f: F) -> Option<R> where
    F: FnOnce() -> Result<R, GError> + GSend,
    R: GSend
[src]

Establish this Runtime as the active runtime.

For the duration of the f closure, any calls to global functions like glsp::sym or glsp::set_global will manipulate this Runtime.

Auto Trait Implementations

impl !GSend for Runtime

impl !GStore for Runtime

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> Erased for T

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.