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