Skip to main content

delegate_const_transcribable

Macro delegate_const_transcribable 

Source
macro_rules! delegate_const_transcribable {
    ($wrapper:ident ($inner_ty:ty)) => { ... };
    ($wrapper:ident { $field:tt : $inner_ty:ty }) => { ... };
    ($wrapper:ident <$($gen:tt),+> ($inner_ty:ty) $(where $($bounds:tt)+)?) => { ... };
    ($wrapper:ident <$($gen:tt),+> { $field:tt : $inner_ty:ty } $(where $($bounds:tt)+)?) => { ... };
    ($wrapper:ident <const $cg_name:ident : $cg_ty:ty> ($inner_ty:ty) $(where $($bounds:tt)+)?) => { ... };
    ($wrapper:ident <const $cg_name:ident : $cg_ty:ty> { $field:tt : $inner_ty:ty } $(where $($bounds:tt)+)?) => { ... };
    ($wrapper:ident <$($gen:tt),+, const $cg_name:ident : $cg_ty:ty> ($inner_ty:ty) $(where $($bounds:tt)+)?) => { ... };
    ($wrapper:ident <$($gen:tt),+, const $cg_name:ident : $cg_ty:ty> { $field:tt : $inner_ty:ty } $(where $($bounds:tt)+)?) => { ... };
}
Expand description

Delegates ConstTranscribable to the single inner field of a newtype. Transcribable is obtained automatically via the blanket impl.

Supports non-generic and generic types with optional where clauses:

delegate_const_transcribable!(MyTuple(InnerType));
delegate_const_transcribable!(MyNamed { field: InnerType });
delegate_const_transcribable!(MyGeneric<T> { field: T } where T: SomeBound);
delegate_const_transcribable!(MyConst<const N: usize>(SomeType));
delegate_const_transcribable!(MyMixed<T, const N: usize> { f: [T; N] } where T: SomeBound);