proc_macro_assertions/into_template.rs
1pub trait TypeEq {
2 type This: ?Sized;
3}
4
5impl<T: ?Sized> TypeEq for T {
6 type This = Self;
7}
8
9/// Convert `Self` into a template, usually some [`Generatable`](crate::generatable::Generatable)
10pub trait IntoTemplate<'a> {
11 /// The type to convert `Self` into
12 type Template;
13
14 /// Convert `Self` into `Self::Template`. The type parameter T is for easy type annotation in
15 /// case of ambiguity into which template it should be converted into
16 fn into_template<T: TypeEq<This = Self::Template>>(self) -> Self::Template;
17}