WithSafety

Trait WithSafety 

Source
pub trait WithSafety<const SAFE: bool> {
    type F: FnPtr + HasSafety<SAFE>;
}
Expand description

Computes the function pointer type obtained by switching between safe/unsafe while preserving arity, ABI, and signature.

Required Associated Types§

Source

type F: FnPtr + HasSafety<SAFE>

The function pointer type with the requested safety (preserving ABI and signature).

Implementations on Foreign Types§

Source§

impl<Ret> WithSafety<false> for fn() -> Ret

Source§

type F = unsafe fn() -> Ret

Source§

impl<Ret> WithSafety<false> for extern "C" fn() -> Ret

Source§

type F = unsafe extern "C" fn() -> Ret

Source§

impl<Ret> WithSafety<false> for extern "system" fn() -> Ret

Source§

type F = unsafe extern "system" fn() -> Ret

Source§

impl<Ret> WithSafety<false> for extern "sysv64" fn() -> Ret

Source§

type F = unsafe extern "sysv64" fn() -> Ret

Source§

impl<Ret> WithSafety<false> for unsafe fn() -> Ret

Source§

type F = unsafe fn() -> Ret

Source§

impl<Ret> WithSafety<false> for unsafe extern "C" fn() -> Ret

Source§

type F = unsafe extern "C" fn() -> Ret

Source§

impl<Ret> WithSafety<false> for unsafe extern "system" fn() -> Ret

Source§

type F = unsafe extern "system" fn() -> Ret

Source§

impl<Ret> WithSafety<false> for unsafe extern "sysv64" fn() -> Ret

Source§

type F = unsafe extern "sysv64" fn() -> Ret

Source§

impl<Ret> WithSafety<true> for fn() -> Ret

Source§

type F = fn() -> Ret

Source§

impl<Ret> WithSafety<true> for extern "C" fn() -> Ret

Source§

type F = extern "C" fn() -> Ret

Source§

impl<Ret> WithSafety<true> for extern "system" fn() -> Ret

Source§

type F = extern "system" fn() -> Ret

Source§

impl<Ret> WithSafety<true> for extern "sysv64" fn() -> Ret

Source§

type F = extern "sysv64" fn() -> Ret

Source§

impl<Ret> WithSafety<true> for unsafe fn() -> Ret

Source§

type F = fn() -> Ret

Source§

impl<Ret> WithSafety<true> for unsafe extern "C" fn() -> Ret

Source§

type F = extern "C" fn() -> Ret

Source§

impl<Ret> WithSafety<true> for unsafe extern "system" fn() -> Ret

Source§

type F = extern "system" fn() -> Ret

Source§

impl<Ret> WithSafety<true> for unsafe extern "sysv64" fn() -> Ret

Source§

type F = extern "sysv64" fn() -> Ret

Source§

impl<Ret, A> WithSafety<false> for fn(A) -> Ret

Source§

type F = unsafe fn(A) -> Ret

Source§

impl<Ret, A> WithSafety<false> for extern "C" fn(A) -> Ret

Source§

type F = unsafe extern "C" fn(A) -> Ret

Source§

impl<Ret, A> WithSafety<false> for extern "system" fn(A) -> Ret

Source§

type F = unsafe extern "system" fn(A) -> Ret

Source§

impl<Ret, A> WithSafety<false> for extern "sysv64" fn(A) -> Ret

Source§

type F = unsafe extern "sysv64" fn(A) -> Ret

Source§

impl<Ret, A> WithSafety<false> for unsafe fn(A) -> Ret

Source§

type F = unsafe fn(A) -> Ret

Source§

impl<Ret, A> WithSafety<false> for unsafe extern "C" fn(A) -> Ret

Source§

type F = unsafe extern "C" fn(A) -> Ret

Source§

impl<Ret, A> WithSafety<false> for unsafe extern "system" fn(A) -> Ret

Source§

type F = unsafe extern "system" fn(A) -> Ret

Source§

impl<Ret, A> WithSafety<false> for unsafe extern "sysv64" fn(A) -> Ret

Source§

type F = unsafe extern "sysv64" fn(A) -> Ret

Source§

impl<Ret, A> WithSafety<true> for fn(A) -> Ret

Source§

type F = fn(A) -> Ret

Source§

impl<Ret, A> WithSafety<true> for extern "C" fn(A) -> Ret

Source§

type F = extern "C" fn(A) -> Ret

Source§

impl<Ret, A> WithSafety<true> for extern "system" fn(A) -> Ret

Source§

type F = extern "system" fn(A) -> Ret

Source§

impl<Ret, A> WithSafety<true> for extern "sysv64" fn(A) -> Ret

Source§

type F = extern "sysv64" fn(A) -> Ret

Source§

impl<Ret, A> WithSafety<true> for unsafe fn(A) -> Ret

Source§

type F = fn(A) -> Ret

Source§

impl<Ret, A> WithSafety<true> for unsafe extern "C" fn(A) -> Ret

Source§

type F = extern "C" fn(A) -> Ret

Source§

impl<Ret, A> WithSafety<true> for unsafe extern "system" fn(A) -> Ret

Source§

type F = extern "system" fn(A) -> Ret

Source§

impl<Ret, A> WithSafety<true> for unsafe extern "sysv64" fn(A) -> Ret

Source§

type F = extern "sysv64" fn(A) -> Ret

Source§

impl<Ret, A, B> WithSafety<false> for fn(A, B) -> Ret

Source§

type F = unsafe fn(A, B) -> Ret

Source§

impl<Ret, A, B> WithSafety<false> for extern "C" fn(A, B) -> Ret

Source§

type F = unsafe extern "C" fn(A, B) -> Ret

Source§

impl<Ret, A, B> WithSafety<false> for extern "system" fn(A, B) -> Ret

Source§

type F = unsafe extern "system" fn(A, B) -> Ret

Source§

impl<Ret, A, B> WithSafety<false> for extern "sysv64" fn(A, B) -> Ret

Source§

type F = unsafe extern "sysv64" fn(A, B) -> Ret

Source§

impl<Ret, A, B> WithSafety<false> for unsafe fn(A, B) -> Ret

Source§

type F = unsafe fn(A, B) -> Ret

Source§

impl<Ret, A, B> WithSafety<false> for unsafe extern "C" fn(A, B) -> Ret

Source§

type F = unsafe extern "C" fn(A, B) -> Ret

Source§

impl<Ret, A, B> WithSafety<false> for unsafe extern "system" fn(A, B) -> Ret

Source§

type F = unsafe extern "system" fn(A, B) -> Ret

Source§

impl<Ret, A, B> WithSafety<false> for unsafe extern "sysv64" fn(A, B) -> Ret

Source§

type F = unsafe extern "sysv64" fn(A, B) -> Ret

Source§

impl<Ret, A, B> WithSafety<true> for fn(A, B) -> Ret

Source§

type F = fn(A, B) -> Ret

Source§

impl<Ret, A, B> WithSafety<true> for extern "C" fn(A, B) -> Ret

Source§

type F = extern "C" fn(A, B) -> Ret

Source§

impl<Ret, A, B> WithSafety<true> for extern "system" fn(A, B) -> Ret

Source§

type F = extern "system" fn(A, B) -> Ret

Source§

impl<Ret, A, B> WithSafety<true> for extern "sysv64" fn(A, B) -> Ret

Source§

type F = extern "sysv64" fn(A, B) -> Ret

Source§

impl<Ret, A, B> WithSafety<true> for unsafe fn(A, B) -> Ret

Source§

type F = fn(A, B) -> Ret

Source§

impl<Ret, A, B> WithSafety<true> for unsafe extern "C" fn(A, B) -> Ret

Source§

type F = extern "C" fn(A, B) -> Ret

Source§

impl<Ret, A, B> WithSafety<true> for unsafe extern "system" fn(A, B) -> Ret

Source§

type F = extern "system" fn(A, B) -> Ret

Source§

impl<Ret, A, B> WithSafety<true> for unsafe extern "sysv64" fn(A, B) -> Ret

Source§

type F = extern "sysv64" fn(A, B) -> Ret

Source§

impl<Ret, A, B, C> WithSafety<false> for fn(A, B, C) -> Ret

Source§

type F = unsafe fn(A, B, C) -> Ret

Source§

impl<Ret, A, B, C> WithSafety<false> for extern "C" fn(A, B, C) -> Ret

Source§

type F = unsafe extern "C" fn(A, B, C) -> Ret

Source§

impl<Ret, A, B, C> WithSafety<false> for extern "system" fn(A, B, C) -> Ret

Source§

type F = unsafe extern "system" fn(A, B, C) -> Ret

Source§

impl<Ret, A, B, C> WithSafety<false> for extern "sysv64" fn(A, B, C) -> Ret

Source§

type F = unsafe extern "sysv64" fn(A, B, C) -> Ret

Source§

impl<Ret, A, B, C> WithSafety<false> for unsafe fn(A, B, C) -> Ret

Source§

type F = unsafe fn(A, B, C) -> Ret

Source§

impl<Ret, A, B, C> WithSafety<false> for unsafe extern "C" fn(A, B, C) -> Ret

Source§

type F = unsafe extern "C" fn(A, B, C) -> Ret

Source§

impl<Ret, A, B, C> WithSafety<false> for unsafe extern "system" fn(A, B, C) -> Ret

Source§

type F = unsafe extern "system" fn(A, B, C) -> Ret

Source§

impl<Ret, A, B, C> WithSafety<false> for unsafe extern "sysv64" fn(A, B, C) -> Ret

Source§

type F = unsafe extern "sysv64" fn(A, B, C) -> Ret

Source§

impl<Ret, A, B, C> WithSafety<true> for fn(A, B, C) -> Ret

Source§

type F = fn(A, B, C) -> Ret

Source§

impl<Ret, A, B, C> WithSafety<true> for extern "C" fn(A, B, C) -> Ret

Source§

type F = extern "C" fn(A, B, C) -> Ret

Source§

impl<Ret, A, B, C> WithSafety<true> for extern "system" fn(A, B, C) -> Ret

Source§

type F = extern "system" fn(A, B, C) -> Ret

Source§

impl<Ret, A, B, C> WithSafety<true> for extern "sysv64" fn(A, B, C) -> Ret

Source§

type F = extern "sysv64" fn(A, B, C) -> Ret

Source§

impl<Ret, A, B, C> WithSafety<true> for unsafe fn(A, B, C) -> Ret

Source§

type F = fn(A, B, C) -> Ret

Source§

impl<Ret, A, B, C> WithSafety<true> for unsafe extern "C" fn(A, B, C) -> Ret

Source§

type F = extern "C" fn(A, B, C) -> Ret

Source§

impl<Ret, A, B, C> WithSafety<true> for unsafe extern "system" fn(A, B, C) -> Ret

Source§

type F = extern "system" fn(A, B, C) -> Ret

Source§

impl<Ret, A, B, C> WithSafety<true> for unsafe extern "sysv64" fn(A, B, C) -> Ret

Source§

type F = extern "sysv64" fn(A, B, C) -> Ret

Source§

impl<Ret, A, B, C, D> WithSafety<false> for fn(A, B, C, D) -> Ret

Source§

type F = unsafe fn(A, B, C, D) -> Ret

Source§

impl<Ret, A, B, C, D> WithSafety<false> for extern "C" fn(A, B, C, D) -> Ret

Source§

type F = unsafe extern "C" fn(A, B, C, D) -> Ret

Source§

impl<Ret, A, B, C, D> WithSafety<false> for extern "system" fn(A, B, C, D) -> Ret

Source§

type F = unsafe extern "system" fn(A, B, C, D) -> Ret

Source§

impl<Ret, A, B, C, D> WithSafety<false> for extern "sysv64" fn(A, B, C, D) -> Ret

Source§

type F = unsafe extern "sysv64" fn(A, B, C, D) -> Ret

Source§

impl<Ret, A, B, C, D> WithSafety<false> for unsafe fn(A, B, C, D) -> Ret

Source§

type F = unsafe fn(A, B, C, D) -> Ret

Source§

impl<Ret, A, B, C, D> WithSafety<false> for unsafe extern "C" fn(A, B, C, D) -> Ret

Source§

type F = unsafe extern "C" fn(A, B, C, D) -> Ret

Source§

impl<Ret, A, B, C, D> WithSafety<false> for unsafe extern "system" fn(A, B, C, D) -> Ret

Source§

type F = unsafe extern "system" fn(A, B, C, D) -> Ret

Source§

impl<Ret, A, B, C, D> WithSafety<false> for unsafe extern "sysv64" fn(A, B, C, D) -> Ret

Source§

type F = unsafe extern "sysv64" fn(A, B, C, D) -> Ret

Source§

impl<Ret, A, B, C, D> WithSafety<true> for fn(A, B, C, D) -> Ret

Source§

type F = fn(A, B, C, D) -> Ret

Source§

impl<Ret, A, B, C, D> WithSafety<true> for extern "C" fn(A, B, C, D) -> Ret

Source§

type F = extern "C" fn(A, B, C, D) -> Ret

Source§

impl<Ret, A, B, C, D> WithSafety<true> for extern "system" fn(A, B, C, D) -> Ret

Source§

type F = extern "system" fn(A, B, C, D) -> Ret

Source§

impl<Ret, A, B, C, D> WithSafety<true> for extern "sysv64" fn(A, B, C, D) -> Ret

Source§

type F = extern "sysv64" fn(A, B, C, D) -> Ret

Source§

impl<Ret, A, B, C, D> WithSafety<true> for unsafe fn(A, B, C, D) -> Ret

Source§

type F = fn(A, B, C, D) -> Ret

Source§

impl<Ret, A, B, C, D> WithSafety<true> for unsafe extern "C" fn(A, B, C, D) -> Ret

Source§

type F = extern "C" fn(A, B, C, D) -> Ret

Source§

impl<Ret, A, B, C, D> WithSafety<true> for unsafe extern "system" fn(A, B, C, D) -> Ret

Source§

type F = extern "system" fn(A, B, C, D) -> Ret

Source§

impl<Ret, A, B, C, D> WithSafety<true> for unsafe extern "sysv64" fn(A, B, C, D) -> Ret

Source§

type F = extern "sysv64" fn(A, B, C, D) -> Ret

Source§

impl<Ret, A, B, C, D, E> WithSafety<false> for fn(A, B, C, D, E) -> Ret

Source§

type F = unsafe fn(A, B, C, D, E) -> Ret

Source§

impl<Ret, A, B, C, D, E> WithSafety<false> for extern "C" fn(A, B, C, D, E) -> Ret

Source§

type F = unsafe extern "C" fn(A, B, C, D, E) -> Ret

Source§

impl<Ret, A, B, C, D, E> WithSafety<false> for extern "system" fn(A, B, C, D, E) -> Ret

Source§

type F = unsafe extern "system" fn(A, B, C, D, E) -> Ret

Source§

impl<Ret, A, B, C, D, E> WithSafety<false> for extern "sysv64" fn(A, B, C, D, E) -> Ret

Source§

type F = unsafe extern "sysv64" fn(A, B, C, D, E) -> Ret

Source§

impl<Ret, A, B, C, D, E> WithSafety<false> for unsafe fn(A, B, C, D, E) -> Ret

Source§

type F = unsafe fn(A, B, C, D, E) -> Ret

Source§

impl<Ret, A, B, C, D, E> WithSafety<false> for unsafe extern "C" fn(A, B, C, D, E) -> Ret

Source§

type F = unsafe extern "C" fn(A, B, C, D, E) -> Ret

Source§

impl<Ret, A, B, C, D, E> WithSafety<false> for unsafe extern "system" fn(A, B, C, D, E) -> Ret

Source§

type F = unsafe extern "system" fn(A, B, C, D, E) -> Ret

Source§

impl<Ret, A, B, C, D, E> WithSafety<false> for unsafe extern "sysv64" fn(A, B, C, D, E) -> Ret

Source§

type F = unsafe extern "sysv64" fn(A, B, C, D, E) -> Ret

Source§

impl<Ret, A, B, C, D, E> WithSafety<true> for fn(A, B, C, D, E) -> Ret

Source§

type F = fn(A, B, C, D, E) -> Ret

Source§

impl<Ret, A, B, C, D, E> WithSafety<true> for extern "C" fn(A, B, C, D, E) -> Ret

Source§

type F = extern "C" fn(A, B, C, D, E) -> Ret

Source§

impl<Ret, A, B, C, D, E> WithSafety<true> for extern "system" fn(A, B, C, D, E) -> Ret

Source§

type F = extern "system" fn(A, B, C, D, E) -> Ret

Source§

impl<Ret, A, B, C, D, E> WithSafety<true> for extern "sysv64" fn(A, B, C, D, E) -> Ret

Source§

type F = extern "sysv64" fn(A, B, C, D, E) -> Ret

Source§

impl<Ret, A, B, C, D, E> WithSafety<true> for unsafe fn(A, B, C, D, E) -> Ret

Source§

type F = fn(A, B, C, D, E) -> Ret

Source§

impl<Ret, A, B, C, D, E> WithSafety<true> for unsafe extern "C" fn(A, B, C, D, E) -> Ret

Source§

type F = extern "C" fn(A, B, C, D, E) -> Ret

Source§

impl<Ret, A, B, C, D, E> WithSafety<true> for unsafe extern "system" fn(A, B, C, D, E) -> Ret

Source§

type F = extern "system" fn(A, B, C, D, E) -> Ret

Source§

impl<Ret, A, B, C, D, E> WithSafety<true> for unsafe extern "sysv64" fn(A, B, C, D, E) -> Ret

Source§

type F = extern "sysv64" fn(A, B, C, D, E) -> Ret

Source§

impl<Ret, A, B, C, D, E, F> WithSafety<false> for fn(A, B, C, D, E, F) -> Ret

Source§

type F = unsafe fn(A, B, C, D, E, F) -> Ret

Source§

impl<Ret, A, B, C, D, E, F> WithSafety<false> for extern "C" fn(A, B, C, D, E, F) -> Ret

Source§

type F = unsafe extern "C" fn(A, B, C, D, E, F) -> Ret

Source§

impl<Ret, A, B, C, D, E, F> WithSafety<false> for extern "system" fn(A, B, C, D, E, F) -> Ret

Source§

type F = unsafe extern "system" fn(A, B, C, D, E, F) -> Ret

Source§

impl<Ret, A, B, C, D, E, F> WithSafety<false> for extern "sysv64" fn(A, B, C, D, E, F) -> Ret

Source§

type F = unsafe extern "sysv64" fn(A, B, C, D, E, F) -> Ret

Source§

impl<Ret, A, B, C, D, E, F> WithSafety<false> for unsafe fn(A, B, C, D, E, F) -> Ret

Source§

type F = unsafe fn(A, B, C, D, E, F) -> Ret

Source§

impl<Ret, A, B, C, D, E, F> WithSafety<false> for unsafe extern "C" fn(A, B, C, D, E, F) -> Ret

Source§

type F = unsafe extern "C" fn(A, B, C, D, E, F) -> Ret

Source§

impl<Ret, A, B, C, D, E, F> WithSafety<false> for unsafe extern "system" fn(A, B, C, D, E, F) -> Ret

Source§

type F = unsafe extern "system" fn(A, B, C, D, E, F) -> Ret

Source§

impl<Ret, A, B, C, D, E, F> WithSafety<false> for unsafe extern "sysv64" fn(A, B, C, D, E, F) -> Ret

Source§

type F = unsafe extern "sysv64" fn(A, B, C, D, E, F) -> Ret

Source§

impl<Ret, A, B, C, D, E, F> WithSafety<true> for fn(A, B, C, D, E, F) -> Ret

Source§

type F = fn(A, B, C, D, E, F) -> Ret

Source§

impl<Ret, A, B, C, D, E, F> WithSafety<true> for extern "C" fn(A, B, C, D, E, F) -> Ret

Source§

type F = extern "C" fn(A, B, C, D, E, F) -> Ret

Source§

impl<Ret, A, B, C, D, E, F> WithSafety<true> for extern "system" fn(A, B, C, D, E, F) -> Ret

Source§

type F = extern "system" fn(A, B, C, D, E, F) -> Ret

Source§

impl<Ret, A, B, C, D, E, F> WithSafety<true> for extern "sysv64" fn(A, B, C, D, E, F) -> Ret

Source§

type F = extern "sysv64" fn(A, B, C, D, E, F) -> Ret

Source§

impl<Ret, A, B, C, D, E, F> WithSafety<true> for unsafe fn(A, B, C, D, E, F) -> Ret

Source§

type F = fn(A, B, C, D, E, F) -> Ret

Source§

impl<Ret, A, B, C, D, E, F> WithSafety<true> for unsafe extern "C" fn(A, B, C, D, E, F) -> Ret

Source§

type F = extern "C" fn(A, B, C, D, E, F) -> Ret

Source§

impl<Ret, A, B, C, D, E, F> WithSafety<true> for unsafe extern "system" fn(A, B, C, D, E, F) -> Ret

Source§

type F = extern "system" fn(A, B, C, D, E, F) -> Ret

Source§

impl<Ret, A, B, C, D, E, F> WithSafety<true> for unsafe extern "sysv64" fn(A, B, C, D, E, F) -> Ret

Source§

type F = extern "sysv64" fn(A, B, C, D, E, F) -> Ret

Implementors§