example
This commit is contained in:
parent
1f710976cc
commit
12788912c7
14
README.md
14
README.md
@ -3,6 +3,20 @@ ID
|
|||||||
|
|
||||||
## Simple macro to generate ::new() and ::get() methods for id types
|
## Simple macro to generate ::new() and ::get() methods for id types
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```rust
|
||||||
|
use id::Id;
|
||||||
|
|
||||||
|
#[derive(Id)]
|
||||||
|
struct ObjectId(u32);
|
||||||
|
|
||||||
|
fn main(){
|
||||||
|
let obj=ObjectId::new(0);
|
||||||
|
let inner=obj.get();//u32
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
#### License
|
#### License
|
||||||
|
|
||||||
<sup>
|
<sup>
|
||||||
|
Loading…
Reference in New Issue
Block a user