A simple trait to mark up the struct and help recognize the struct's attributes. A simple trait to mark up the struct and help recognize the struct's attributes.
# Example
```rust use acts_tag::{Tags, Value}; use std::any::Any;
pub struct MyTags { // tag(id) change the key to id #[tag(id)] pub myid: String, #[tag] pub tag1: String, #[tag] pub tag2: i32, pub others: String, } fn main() { let t = MyTags { myid: "my id".tostring(), tag1: "a".tostring(), tag2: 5, others: "others".tostring(), }; asserteq!(MyTags::keys(), vec![ "id", "tag1", "tag2" ]);
for tag_key in &MyTags::keys() {
let value = t.value(tag_key).unwrap();
println!("value {} = {:?}", tag_key, value);
}
let value = t.value("id").unwrap();
assert_eq!(value.real::<String>().unwrap(), t.my_id);
let value = t.value("tag1").unwrap();
assert_eq!(value.real::<String>().unwrap(), t.tag1);
let value = t.value("tag2").unwrap();
assert_eq!(value.real::<i32>().unwrap(), t.tag2);
let value = t.value("others");
assert_eq!(value, None);
let is_tag = t.is_tag("others");
assert_eq!(is_tag, false);
let is_tag = t.is_tag("tag2");
assert_eq!(is_tag, true);
} ```