Crates.io | local-type-alias |
lib.rs | local-type-alias |
version | 0.1.5 |
source | src |
created_at | 2024-02-22 10:53:05.793082 |
updated_at | 2024-03-04 10:42:05.216338 |
description | Local type aliases in impl blocks |
homepage | |
repository | https://github.com/Spartan2909/local-type-alias |
max_upload_size | |
id | 1149192 |
size | 19,465 |
local-type-alias
provides an attribute macro for creating scoped type and trait aliases in an item.
#[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,
{
// ...
}