macro_rules! context {
(
$vis:vis struct $name:ident
$(< $( $lt:tt $( : $clt:tt $(+ $dlt:tt )* )? ),+ $(,)?>)?
{
$($(
$field_1:ident $($field_2:ident)? : $field_mod:ident $field_ty:ty
),+ $(,)?)?
}
) => { ... };
(
@impl
[$name:ident] [$vis:vis] [$ty:ident] [$this:ident] [$($g:tt)*] [$($r:tt)*]
[$($struct_fields:tt)*]
[$($ctor_args:tt)*]
[$($ctor_assignments:tt)*]
[$($struct_methods:tt)*]
[$($trait_impl_ref:tt)*]
[$($trait_impl_mut:tt)*]
[$field:ident : ref $field_ty:ty $(, $($other_fields:tt)+)?]
) => { ... };
(
@impl
[$name:ident] [$vis:vis] [$ty:ident] [$this:ident] [$($g:tt)*] [$($r:tt)*]
[$($struct_fields:tt)*]
[$($ctor_args:tt)*]
[$($ctor_assignments:tt)*]
[$($struct_methods:tt)*]
[$($trait_impl_ref:tt)*]
[$($trait_impl_mut:tt)*]
[dyn $field:ident : ref $field_ty:ty $(, $($other_fields:tt)+)?]
) => { ... };
(
@impl
[$name:ident] [$vis:vis] [$ty:ident] [$this:ident] [$($g:tt)*] [$($r:tt)*]
[$($struct_fields:tt)*]
[$($ctor_args:tt)*]
[$($ctor_assignments:tt)*]
[$($struct_methods:tt)*]
[$($trait_impl_ref:tt)*]
[$($trait_impl_mut:tt)*]
[$field:ident : mut $field_ty:ty $(, $($other_fields:tt)+)?]
) => { ... };
(
@impl
[$name:ident] [$vis:vis] [$ty:ident] [$this:ident] [$($g:tt)*] [$($r:tt)*]
[$($struct_fields:tt)*]
[$($ctor_args:tt)*]
[$($ctor_assignments:tt)*]
[$($struct_methods:tt)*]
[$($trait_impl_ref:tt)*]
[$($trait_impl_mut:tt)*]
[dyn $field:ident : mut $field_ty:ty $(, $($other_fields:tt)+)?]
) => { ... };
(
@impl
[$name:ident] [$vis:vis] [$ty:ident] [$this:ident] [$($g:tt)*] [$($r:tt)*]
[$($struct_fields:tt)*]
[$($ctor_args:tt)*]
[$($ctor_assignments:tt)*]
[$($struct_methods:tt)*]
[$($trait_impl_ref:tt)*]
[$($trait_impl_mut:tt)*]
[$field:ident : const $field_ty:ty $(, $($other_fields:tt)+)?]
) => { ... };
(
@impl
[$name:ident] [$vis:vis] [$ty:ident] [$this:ident] [$($g:tt)*] [$($r:tt)*]
[$($struct_fields:tt)*]
[$($ctor_args:tt)*]
[$($ctor_assignments:tt)*]
[$($struct_methods:tt)*]
[$($trait_impl_ref:tt)*]
[$($trait_impl_mut:tt)*]
[$field:ident : const $field_ty:ty $(, $($other_fields:tt)+)?]
) => { ... };
(
@impl
[$name:ident] [$vis:vis] [$ty:ident] [$this:ident] [$($g:tt)*] [$($r:tt)*]
[$($struct_fields:tt)*]
[$($ctor_args:tt)*]
[$($ctor_assignments:tt)*]
[$($struct_methods:tt)*]
[$($trait_impl_ref:tt)*]
[$($trait_impl_mut:tt)*]
[$field_1:ident $($field_2:ident)? : $field_mod:ident $field_ty:ty $(, $($other_fields:tt)+)?]
) => { ... };
(
@impl
[$name:ident] [$vis:vis] [$ty:ident] [$this:ident] [$($g:tt)*] [$($r:tt)*]
[$($struct_fields:tt)*]
[$($ctor_args:tt)*]
[$($ctor_assignments:tt)*]
[$($struct_methods:tt)*]
[$($trait_impl_ref:tt)*]
[$($trait_impl_mut:tt)*]
[]
) => { ... };
(
@impl struct
[$name:ident] [$vis:vis] [$ty:ident] [$this:ident] [$($g:tt)*] [$($r:tt)*]
[$($struct_fields:tt)*]
[$($ctor_args:tt)*]
[$($ctor_assignments:tt)*]
[$($struct_methods:tt)*]
) => { ... };
(
@impl trait
[$name:ident] [$ty:ident] [$this:ident] [$($g:tt)*] [$($r:tt)*]
[] []
) => { ... };
(
@impl trait
[$name:ident] [$ty:ident] [$this:ident] [$($g:tt)*] [$($r:tt)*]
[$($trait_impl_ref:tt)*]
[$($trait_impl_mut:tt)*]
) => { ... };
}