Struct mun_runtime::Runtime

source ·
pub struct Runtime { /* private fields */ }
Expand description

A runtime for the Mun language.

Logging

The runtime uses log as a logging facade, but does not install a logger. To produce log output, you have to use a logger implementation compatible with the facade.

Implementations§

Constructs a new RuntimeBuilder to construct a new Runtime instance.

Constructs a new Runtime that loads the library at library_path and its dependencies. The Runtime contains a file watcher that is triggered with an interval of dur.

Safety

A munlib is simply a shared object. When a library is loaded, initialisation routines contained within it are executed. For the purposes of safety, the execution of these routines is conceptually the same calling an unknown foreign function and may impose arbitrary requirements on the caller for the call to be sound.

Additionally, the callers of this function must also ensure that execution of the termination routines contained within the library is safe as well. These routines may be executed when the library is unloaded.

See Assembly::load for more information.

Retrieves the function definition corresponding to function_name, if available.

Retrieves the type definition corresponding to type_name, if available.

Retrieve the type information corresponding to the type_id, if available.

Updates the state of the runtime. This includes checking for file changes, and reloading compiled assemblies.

Safety

A munlib is simply a shared object. When a library is loaded, initialisation routines contained within it are executed. For the purposes of safety, the execution of these routines is conceptually the same calling an unknown foreign function and may impose arbitrary requirements on the caller for the call to be sound.

Additionally, the callers of this function must also ensure that execution of the termination routines contained within the library is safe as well. These routines may be executed when the library is unloaded.

See Assembly::load for more information.

Returns a shared reference to the runtime’s garbage collector.

We cannot return an Arc here, because the lifetime of data contained in GarbageCollector is dependent on the Runtime.

Collects all memory that is no longer referenced by rooted objects. Returns true if memory was reclaimed, false otherwise. This behavior will likely change in the future.

Returns statistics about the garbage collector.

Constructs an array with a predefined element type.

Constructs an array from an iterator

Invokes the Mun function called function_name with the specified arguments.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.