pub trait FnPtr: Copy {
// Required methods
fn as_ptr(self) -> NonNull<Code>;
unsafe fn from_ptr(ptr: NonNull<Code>) -> Self;
// Provided method
fn addr(self) -> usize { ... }
}🔬This is a nightly-only experimental API. (
fn_static)Available on crate features
crypto and std only.Expand description
A common trait implemented by all function pointers.
Required Methods§
Sourcefn as_ptr(self) -> NonNull<Code>
🔬This is a nightly-only experimental API. (fn_static)
fn as_ptr(self) -> NonNull<Code>
fn_static)Returns the function pointer as a NonNull<Code>.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".