pub struct AssemblyDelegateLoader { /* private fields */ }netcore3_0 only.Expand description
A struct for loading pointers to managed functions for a given HostfxrContext which automatically loads the
assembly from the given path on the first access.
Implementations§
Source§impl AssemblyDelegateLoader
impl AssemblyDelegateLoader
Sourcepub fn new(loader: DelegateLoader, assembly_path: impl Into<PdCString>) -> Self
pub fn new(loader: DelegateLoader, assembly_path: impl Into<PdCString>) -> Self
Creates a new AssemblyDelegateLoader wrapping the given DelegateLoader loading the assembly
from the given path on the first access.
Sourcepub fn get_function<F: FnPtr + WithAbi<System>>(
&self,
type_name: &PdCStr,
method_name: &PdCStr,
delegate_type_name: &PdCStr,
) -> Result<ManagedFunction<<F as WithAbi<System>>::F>, GetManagedFunctionError>
pub fn get_function<F: FnPtr + WithAbi<System>>( &self, type_name: &PdCStr, method_name: &PdCStr, delegate_type_name: &PdCStr, ) -> Result<ManagedFunction<<F as WithAbi<System>>::F>, GetManagedFunctionError>
If this is the first loaded function pointer, calling this function will load the specified assembly in
isolation (into its own AssemblyLoadContext) and it will use AssemblyDependencyResolver on it to provide
dependency resolution.
Otherwise or once loaded it will find the specified type and method and return a native function pointer to that method.
Calling this function will find the specified type and method and return a native function pointer to that method.
§Arguments
type_name: Assembly qualified type name to findmethod_name: Name of the method on thetype_nameto find. The method must be static and must match the signature ofdelegate_type_name.delegate_type_name: Assembly qualified delegate type name for the method signature.
Sourcepub fn get_function_with_default_signature(
&self,
type_name: &PdCStr,
method_name: &PdCStr,
) -> Result<ManagedFunctionWithDefaultSignature, GetManagedFunctionError>
pub fn get_function_with_default_signature( &self, type_name: &PdCStr, method_name: &PdCStr, ) -> Result<ManagedFunctionWithDefaultSignature, GetManagedFunctionError>
If this is the first loaded function pointer, calling this function will load the specified assembly in
isolation (into its own AssemblyLoadContext) and it will use AssemblyDependencyResolver on it to provide
dependency resolution.
Otherwise or once loaded it will find the specified type and method and return a native function pointer to that method.
Calling this function will find the specified type and method and return a native function pointer to that method.
§Arguments
type_name: Assembly qualified type name to findmethod_name: Name of the method on thetype_nameto find. The method must be static and must match the following signature:public delegate int ComponentEntryPoint(IntPtr args, int sizeBytes);
Sourcepub fn get_function_with_unmanaged_callers_only<F: FnPtr + WithAbi<System>>(
&self,
type_name: &PdCStr,
method_name: &PdCStr,
) -> Result<ManagedFunction<<F as WithAbi<System>>::F>, GetManagedFunctionError>
Available on crate feature net5_0 only.
pub fn get_function_with_unmanaged_callers_only<F: FnPtr + WithAbi<System>>( &self, type_name: &PdCStr, method_name: &PdCStr, ) -> Result<ManagedFunction<<F as WithAbi<System>>::F>, GetManagedFunctionError>
net5_0 only.If this is the first loaded function pointer, calling this function will load the specified assembly in
isolation (into its own AssemblyLoadContext) and it will use AssemblyDependencyResolver on it to provide
dependency resolution.
Otherwise or once loaded it will find the specified type and method and return a native function pointer to that method.
Calling this function will find the specified type and method and return a native function pointer to that method.
§Arguments
type_name: Assembly qualified type name to findmethod_name: Name of the method on thetype_nameto find. The method must be static and must match be annotated withUnmanagedCallersOnly.
Trait Implementations§
Source§impl Clone for AssemblyDelegateLoader
impl Clone for AssemblyDelegateLoader
Source§fn clone(&self) -> AssemblyDelegateLoader
fn clone(&self) -> AssemblyDelegateLoader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more