pub trait AsSafe: WithSafety<Safe> {
type F: FnPtr<Args = Self::Args, Output = Self::Output, Safety = Safe, Abi = Self::Abi>;
}Expand description
Helper trait to compute the safe version of a function pointer type while preserving its abi, arguments and return type. Equivalent to WithSafety<Safe>.
§Example
type U = unsafe extern "C" fn(i32) -> i32;
type S = <U as AsSafe>::F;
// `S` is `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.