pub struct FnRev<F: ?Sized>(/* private fields */);
Expand description
Reverses an InjTypeFn
, its arguments become return values,
and its return values become arguments.
§Examples
§Permutations
The different ways this function can be combined with CallFn
and
UncallFn
use typewit::type_fn::{CallFn, FnRev, UncallFn};
let _: CallFn<FnRev<Swap>, Right> = Left;
let _: UncallFn< Swap, Right> = Left;
let _: CallFn< Swap, Up> = Down;
let _: UncallFn<FnRev<Swap>, Up> = Down;
typewit::inj_type_fn!{
struct Swap;
impl Left => Right;
impl Up => Down;
}
struct Left;
struct Right;
struct Up;
struct Down;
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for FnRev<F>where
F: ?Sized,
impl<F> RefUnwindSafe for FnRev<F>where
F: ?Sized,
impl<F> Send for FnRev<F>where
F: ?Sized,
impl<F> Sync for FnRev<F>where
F: ?Sized,
impl<F> Unpin for FnRev<F>where
F: ?Sized,
impl<F> UnwindSafe for FnRev<F>where
F: ?Sized,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more