Struct mun_runtime::Assembly
source · pub struct Assembly { /* private fields */ }
Expand description
An assembly is a hot reloadable compilation unit, consisting of one or more Mun modules.
Implementations§
source§impl Assembly
impl Assembly
sourcepub unsafe fn load(
library_path: &Path,
gc: Arc<MarkSweep<NoopObserver<Event>>>
) -> Result<Self, Error>
pub unsafe fn load(
library_path: &Path,
gc: Arc<MarkSweep<NoopObserver<Event>>>
) -> Result<Self, Error>
Loads an assembly and its information for the shared library at library_path
. The
resulting Assembly
is ensured to be linkable.
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 [libloading::Library::new
] for more information.
sourcepub fn info(&self) -> &AssemblyInfo<'_>
pub fn info(&self) -> &AssemblyInfo<'_>
Returns the assembly’s information.
sourcepub fn info_mut(&mut self) -> &mut AssemblyInfo<'_>
pub fn info_mut(&mut self) -> &mut AssemblyInfo<'_>
Returns the assembly’s information.
sourcepub fn library_path(&self) -> &Path
pub fn library_path(&self) -> &Path
Returns the path corresponding to the assembly’s library.
sourcepub fn into_library(self) -> TempLibrary
pub fn into_library(self) -> TempLibrary
Converts the Assembly
into a TempLibrary
, consuming the input in the process.