Trait tuple_fn::KnownFnPointer
source · [−]pub trait KnownFnPointer: TupleFn<Self::ArgsTuple> {
type ArgsTuple;
type FnPointerWithRefArgs;
type DynFnOnce: ?Sized;
type DynFnMut: ?Sized;
type DynFn: ?Sized;
}Required Associated Types
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)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) -> StringThe 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) -> StringThe 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) -> StringThe 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