pub trait WithSafety<Safety: Safety>: FnPtr {
type F: FnPtr<Args = Self::Args, Output = Self::Output, Safety = Safety, Abi = Self::Abi>;
}Expand description
Helper trait to change the safety of a function pointer type while preserving its abi, arguments and return type.
This is used by with_safety! under the hood.
§Example
type F = extern "C" fn(i32) -> i32;
type G = <F as WithSafety<safety::Unsafe>>::F;
// `G` is `unsafe extern "C" fn(i32) -> i32`Required Associated Types§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.