pub trait KnownFnPointer: TupleFn<Self::ArgsTuple> {
type ArgsTuple;
type FnPointerWithRefArgs;
type DynFnOnce: ?Sized;
type DynFnMut: ?Sized;
type DynFn: ?Sized;
}
Required Associated Types§
Sourcetype ArgsTuple
type ArgsTuple
The type of arguments tuple of this fn
pointer.
For example, the following types in each pair are equivalent.
<fn() -> String as KnownFnPointer>::ArgsTuple
()
<fn(i32) -> String as KnownFnPointer>::ArgsTuple
(i32,)
<fn(i32, bool) -> String as KnownFnPointer>::ArgsTuple
(i32, bool)
Sourcetype FnPointerWithRefArgs
type FnPointerWithRefArgs
The type of the fn
pointer which accepts corresponding references of arguments.
For example, the following types in each pair are equivalent.
<fn() -> String as KnownFnPointer>::FnPointerWithRefArgs
fn() -> String
<fn(i32) -> String as KnownFnPointer>::FnPointerWithRefArgs
fn(&i32) -> String
<fn(i32, bool) -> String as KnownFnPointer>::FnPointerWithRefArgs
fn(&i32, &bool) -> String
Sourcetype DynFnOnce: ?Sized
type DynFnOnce: ?Sized
The corresponding dyn FnOnce
type.
For example, the following types in each pair are equivalent.
<fn() -> String as KnownFnPointer>::DynFnOnce
dyn FnOnce() -> String
<fn(i32) -> String as KnownFnPointer>::DynFnOnce
dyn FnOnce(i32) -> String
<fn(i32, bool) -> String as KnownFnPointer>::DynFnOnce
dyn FnOnce(i32, bool) -> String
Sourcetype DynFnMut: ?Sized
type DynFnMut: ?Sized
The corresponding dyn DynFnMut
type.
For example, the following types in each pair are equivalent.
<fn() -> String as KnownFnPointer>::DynFnMut
dyn FnMut() -> String
<fn(i32) -> String as KnownFnPointer>::DynFnMut
dyn FnMut(i32) -> String
<fn(i32, bool) -> String as KnownFnPointer>::DynFnMut
dyn FnMut(i32, bool) -> String
Sourcetype DynFn: ?Sized
type DynFn: ?Sized
The corresponding dyn DynFn
type.
For example, the following types in each pair are equivalent.
<fn() -> String as KnownFnPointer>::DynFn
dyn Fn() -> String
<fn(i32) -> String as KnownFnPointer>::DynFn
dyn Fn(i32) -> String
<fn(i32, bool) -> String as KnownFnPointer>::DynFn
dyn Fn(i32, bool) -> String
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.