Trait netcorehost::hostfxr::FunctionPtr
source · pub unsafe trait FunctionPtr: Sized + Copy + Send + Sync + 'static {
type Args;
type Output;
type Managed: ManagedFunctionPtr;
const ARITY: usize;
// Required methods
unsafe fn from_ptr(ptr: RawFunctionPtr) -> Self;
fn as_ptr(&self) -> RawFunctionPtr;
}
Available on crate feature
netcore3_0
only.Expand description
Trait representing a function pointer.
§Safety
This trait should only be implemented for function pointers and the associated types and constants have to match the function pointer type.
Required Associated Types§
sourcetype Managed: ManagedFunctionPtr
type Managed: ManagedFunctionPtr
The extern "system"
version of this function pointer.
Required Associated Constants§
Required Methods§
sourceunsafe fn from_ptr(ptr: RawFunctionPtr) -> Self
unsafe fn from_ptr(ptr: RawFunctionPtr) -> Self
Constructs a FunctionPtr
from an untyped function pointer.
§Safety
This function is unsafe because it can not check if the argument points to a function of the correct type.
sourcefn as_ptr(&self) -> RawFunctionPtr
fn as_ptr(&self) -> RawFunctionPtr
Returns a untyped function pointer for this function.
Object Safety§
This trait is not object safe.