Crate local_type_alias

source ·
Expand description

local-type-aliases allows for the creation of scoped type and trait aliases in an item.

§Examples

#[local_alias]
#[alias(type X = i32)]
struct MyType<T>
where
    X: for<'a> Add<&'a T>,
{
    value: T,
}
#[local_alias]
#[alias(
    type X = [u8; 4],
    type Y = *mut X,
    type Z = fn(X) -> Y,
    trait A = PartialEq<fn([u8; 4]) -> *mut X>,
)]
impl<T> MyType<T>
where
    Z: A,
{
    // ...
}

Attribute Macros§