Struct netcorehost::hostfxr::HostfxrContext [−][src]
pub struct HostfxrContext<'a, I> { /* fields omitted */ }
Expand description
State which hostfxr creates and maintains and represents a logical operation on the hosting components.
Implementations
Gets the runtime property value for the given key of this host context.
Gets the runtime property value for the given key of this host context.
Safety
The value string is owned by the host context. The lifetime of the buffer is only guaranteed until any of the below occur:
run_app
is called for this host context- properties are changed via
set_runtime_property_value
orremove_runtime_property_value
- the host context is dropped
Sets the value of a runtime property for this host context.
Remove a runtime property for this host context.
Get all runtime properties for this host context.
Safety
The strings returned are owned by the host context. The lifetime of the buffers is only guaranteed until any of the below occur:
run_app
is called for this host context- properties are changed via
set_runtime_property_value
orremove_runtime_property_value
- the host context is dropped
Get all runtime properties for this host context as owned strings.
Get all runtime properties for this host context as an iterator over borrowed key-value pairs.
Safety
The strings returned are owned by the host context. The lifetime of the buffers is only guaranteed until any of the below occur:
run_app
is called for this host context- properties are changed via
set_runtime_property_value
orremove_runtime_property_value
- the host context is dropped
Get all runtime properties for this host context as an iterator over owned key-value pairs.
Get all runtime properties for this host context as an hashmap of borrowed strings.
Safety
The strings returned are owned by the host context. The lifetime of the buffers is only guaranteed until any of the below occur:
run_app
is called for this host context- properties are changed via
set_runtime_property_value
orremove_runtime_property_value
- the host context is dropped
Get all runtime properties for this host context as an hashmap of owned strings.
pub fn get_runtime_delegate(
&self,
type: hostfxr_delegate_type
) -> Result<MethodWithUnknownSignature, Error>
pub fn get_runtime_delegate(
&self,
type: hostfxr_delegate_type
) -> Result<MethodWithUnknownSignature, Error>
Gets a typed delegate from the currently loaded CoreCLR or from a newly created one.
You propably want to use get_delegate_loader
or get_delegate_loader_for_assembly
instead of this function if you want to load function pointers.
Remarks
If the context was initialized using initialize_for_runtime_config
, then all delegate types are supported.
If it was initialized using initialize_for_dotnet_command_line
, then only the following
delegate types are currently supported:
Gets a delegate loader for loading an assembly and contained function pointers.
pub fn get_delegate_loader_for_assembly<A: AsRef<PdCStr>>(
&self,
assembly_path: A
) -> Result<AssemblyDelegateLoader<A>, Error>
pub fn get_delegate_loader_for_assembly<A: AsRef<PdCStr>>(
&self,
assembly_path: A
) -> Result<AssemblyDelegateLoader<A>, Error>
Gets a delegate loader for loading function pointers of the assembly with the given path. The assembly will be loaded lazily when the first function pointer is loaded.
Load CoreCLR and run the application.
Return value
If the app was successfully run, the exit code of the application. Otherwise, the error code result.
Trait Implementations
Auto Trait Implementations
impl<'a, I> RefUnwindSafe for HostfxrContext<'a, I> where
I: RefUnwindSafe,
impl<'a, I> !Send for HostfxrContext<'a, I>
impl<'a, I> !Sync for HostfxrContext<'a, I>
impl<'a, I> Unpin for HostfxrContext<'a, I>
impl<'a, I> UnwindSafe for HostfxrContext<'a, I> where
I: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more