Skip to main content

FnPtr

Trait FnPtr 

Source
pub unsafe trait FnPtr: FnAddr {
    // Required method
    unsafe fn from_ptr(ptr: NonNull<Code>) -> Self;
}
🔬This is a nightly-only experimental API. (fn_static #148768)
Expand description

A common trait implemented by all function pointers.

Required Methods§

Source

unsafe fn from_ptr(ptr: NonNull<Code>) -> Self

🔬This is a nightly-only experimental API. (fn_static #148768)

Constructs a function pointer from a NonNull pointer.

§Safety

The function pointer must have been obtained from an FnAddr::as_ptr call from a function pointer type that is ABI compatible.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§