Convenient macro for newtype wrapped ids
Go to file
2024-02-07 04:18:43 -08:00
src parse field type 2024-02-07 04:05:04 -08:00
.gitignore Initial commit 2024-02-06 19:34:25 -08:00
Cargo.lock Initial commit 2024-02-06 19:34:25 -08:00
Cargo.toml Initial commit 2024-02-06 19:34:25 -08:00
LICENSE-APACHE crate boilerplate 2024-02-06 19:40:05 -08:00
LICENSE-MIT crate boilerplate 2024-02-06 19:40:05 -08:00
README.md example 2024-02-07 04:18:43 -08:00

ID

Simple macro to generate ::new() and ::get() methods for id types

Example

use id::Id;

#[derive(Id)]
struct ObjectId(u32);

fn main(){
	let obj=ObjectId::new(0);
	let inner=obj.get();//u32
}

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.