pub struct DotNetLibraryBundle { /* private fields */ }
Expand description
A location on the file system and an associated .NET DLL bundle to host a .NET runtime for.
Uses the DOTNET_RAWFILEREADER_BUNDLE_PATH
environment variable when a default
is required, otherwise creates a temporary directory whose lifespan is linked to this
object.
Implementations§
Source§impl DotNetLibraryBundle
impl DotNetLibraryBundle
Sourcepub fn new(dir: Option<&str>) -> Result<Self>
pub fn new(dir: Option<&str>) -> Result<Self>
Create a new bundle directory. If a path string is provided, that path will be used. Otherwise a temporary directory will be created.
Sourcepub fn runtime(&self) -> Arc<AssemblyDelegateLoader>
pub fn runtime(&self) -> Arc<AssemblyDelegateLoader>
Get a reference to the .NET runtime, creating it if one has not yet been created.
This function will panic if a runtime cannot be found. Calls DotNetLibraryBundle::try_runtime
and unwraps.
See DotNetLibraryBundle::try_create_runtime
for specific runtime creation
Sourcepub fn try_runtime(
&self,
) -> Result<Arc<AssemblyDelegateLoader>, DotNetRuntimeCreationError>
pub fn try_runtime( &self, ) -> Result<Arc<AssemblyDelegateLoader>, DotNetRuntimeCreationError>
Get a reference to the .NET runtime, creating it if one has not yet been created or return an error if the runtime could not be created.
See DotNetLibraryBundle::try_create_runtime
for specific runtime creation
Sourcepub fn write_bundle(&self) -> Result<()>
pub fn write_bundle(&self) -> Result<()>
Write all of the bundled .NET DLLs to the file system at this location