Struct netcorehost::hostfxr::AssemblyDelegateLoader
source · [−]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
Creates a new AssemblyDelegateLoader
wrapping the given DelegateLoader
loading the assembly
from the given path on the first access.
pub fn get_function_pointer(
&'a self,
type_name: impl AsRef<PdCStr>,
method_name: impl AsRef<PdCStr>,
delegate_type_name: impl AsRef<PdCStr>
) -> Result<MethodWithUnknownSignature, GetFunctionPointerError>
pub fn get_function_pointer(
&'a self,
type_name: impl AsRef<PdCStr>,
method_name: impl AsRef<PdCStr>,
delegate_type_name: impl AsRef<PdCStr>
) -> Result<MethodWithUnknownSignature, GetFunctionPointerError>
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_name
to 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.
pub fn get_function_pointer_with_default_signature(
&'a self,
type_name: impl AsRef<PdCStr>,
method_name: impl AsRef<PdCStr>
) -> Result<MethodWithDefaultSignature, GetFunctionPointerError>
pub fn get_function_pointer_with_default_signature(
&'a self,
type_name: impl AsRef<PdCStr>,
method_name: impl AsRef<PdCStr>
) -> Result<MethodWithDefaultSignature, GetFunctionPointerError>
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_name
to find. The method must be static and must match the following signature:public delegate int ComponentEntryPoint(IntPtr args, int sizeBytes);
pub fn get_function_pointer_for_unmanaged_callers_only_method(
&'a self,
type_name: impl AsRef<PdCStr>,
method_name: impl AsRef<PdCStr>
) -> Result<MethodWithUnknownSignature, GetFunctionPointerError>
pub fn get_function_pointer_for_unmanaged_callers_only_method(
&'a self,
type_name: impl AsRef<PdCStr>,
method_name: impl AsRef<PdCStr>
) -> Result<MethodWithUnknownSignature, GetFunctionPointerError>
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_name
to find. The method must be static and must match be annotated withUnmanagedCallersOnly
.