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: 'static> WithSafety<false> for fn() -> Ret

Source§

type F = unsafe fn() -> Ret

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type F = unsafe fn() -> Ret

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<Ret: 'static> WithSafety<true> for fn() -> Ret

Source§

type F = fn() -> Ret

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type F = fn() -> Ret

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type F = unsafe fn(A) -> Ret

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type F = unsafe fn(A) -> Ret

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type F = fn(A) -> Ret

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type F = fn(A) -> Ret

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<Ret: 'static, A: 'static, B: 'static, C: 'static> 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: 'static, A: 'static, B: 'static, C: 'static> 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: 'static, A: 'static, B: 'static, C: 'static> WithSafety<true> for fn(A, B, C) -> Ret

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<Ret: 'static, A: 'static, B: 'static, C: 'static, D: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static> WithSafety<false> for unsafe fn(A, B, C, D) -> Ret

Source§

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

Source§

impl<Ret: 'static, A: 'static, B: 'static, C: 'static, D: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static> WithSafety<true> for fn(A, B, C, D) -> Ret

Source§

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

Source§

impl<Ret: 'static, A: 'static, B: 'static, C: 'static, D: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static> WithSafety<true> for unsafe fn(A, B, C, D) -> Ret

Source§

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

Source§

impl<Ret: 'static, A: 'static, B: 'static, C: 'static, D: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static> WithSafety<false> for fn(A, B, C, D, E) -> Ret

Source§

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

Source§

impl<Ret: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static> WithSafety<true> for fn(A, B, C, D, E) -> Ret

Source§

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

Source§

impl<Ret: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static> WithSafety<true> for unsafe fn(A, B, C, D, E) -> Ret

Source§

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

Source§

impl<Ret: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static> 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: 'static, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static> 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

Implementors§