5 stable releases

1.1.2 Feb 13, 2025
1.1.1 Oct 17, 2021
1.1.0 Jul 15, 2020
1.0.1 Nov 23, 2019

#334 in Encoding

Download history 256/week @ 2024-12-16 105/week @ 2024-12-23 220/week @ 2024-12-30 252/week @ 2025-01-06 175/week @ 2025-01-13 208/week @ 2025-01-20 180/week @ 2025-01-27 259/week @ 2025-02-03 388/week @ 2025-02-10 139/week @ 2025-02-17 123/week @ 2025-02-24 127/week @ 2025-03-03 179/week @ 2025-03-10 303/week @ 2025-03-17 306/week @ 2025-03-24 156/week @ 2025-03-31

952 downloads per month
Used in 96 crates (10 directly)

MIT license

6KB
129 lines

TypId

Typed Unique Identifier gives you ability to create and use identifiers bound to specified type.

Installation

Cargo.toml

[dependencies]
typid = "1"

Example

use typid::ID;

struct Foo {
    pub id: ID<Foo>,
}

fn main() {
    let a = Foo { id: ID::new() };
    let b = Foo { id: ID::new() };
    assert_ne!(a.id, b.id);
}

Dependencies

~0.3–1MB
~23K SLoC