Macro higher_kinded_types::ForLt
source · macro_rules! ForLt { (< $lt:lifetime > = $T:ty $(,)?) => { ... }; ($($shorthand_syntax:tt)*) => { ... }; }
Expand description
Produce impl ForLt
1 types on demand.
Syntax
Full syntax
ForLt!(<'r> = some::Arbitrary<'r, Type>)
Shorthand syntax
You can use the anonymous/elided
'_
lifetime (or even implicitly elided if behind&
) in which case you skip the<'lt> =
part, and just write:ForLt!(some::Arbitrary<'_, Type>)
Examples
use ::higher_kinded_types::ForLt;
type A = ForLt!(<'r> = &'r str);
// the following two definitions are equivalent to A (syntax sugar).
type B = ForLt!(&'_ str);
type C = ForLt!(&str);
// Let `'r` be `'static`, this results in:
// |
// vvvvvvv
let a: <A as ForLt>::Of<'static> = "a";
// ^^^^^^^^^^^^^^^^^^^^^^^^^
// `&'static str` !
// vvvvvvvvvvvvvvvvvvvvvvvvv
let b: <B as ForLt>::Of<'static> = "b";
let c: <C as ForLt>::Of<'static> = "c";
+ Send + Sync + Unpin
↩