local-type-alias

Crates.iolocal-type-alias
lib.rslocal-type-alias
version0.1.5
sourcesrc
created_at2024-02-22 10:53:05.793082
updated_at2024-03-04 10:42:05.216338
descriptionLocal type aliases in impl blocks
homepage
repositoryhttps://github.com/Spartan2909/local-type-alias
max_upload_size
id1149192
size19,465
(Spartan2909)

documentation

https://docs.rs/local-type-alias

README

Local type aliases

local-type-alias provides an attribute macro for creating 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 = [T; 4],
    type Y = *mut X,
    type Z = fn(X) -> Y,
    trait A = PartialEq<fn([u8; 4]) -> *mut [u8; 4]>,
)]
impl<T> MyType<T>
where
    Z: A,
{
    // ...
}
Commit count: 0

cargo fmt