Trait SafeFn
Source pub trait SafeFn {
type RawFn;
// Required methods
unsafe fn from_raw(raw: Self::RawFn) -> Self;
fn to_raw(self) -> Self::RawFn;
}
Expand description
Auxiliary conversion methods for CFunction and Hook.
(CFunction and Hook are simple type definitions, so methods can’t be implemented directly…)
The raw version of this function type.
Converts the given raw function into their safe version.
§Safety
raw must always be safe to call.
Converts this function into their raw version.
The returned function is safe to call as long as the function receives valid pointers for any pointer argument it may have.
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".