Skip to main content

tanuki_common/
meta.rs

1use compact_str::CompactString;
2
3use crate::property;
4
5pub trait MetaField: crate::Property {}
6
7#[property(MetaField, State, key = "name")]
8pub struct Name(pub CompactString);
9
10#[property(MetaField, State, key = "type")]
11pub struct Type(pub CompactString);
12
13#[property(MetaField, State, key = "provider")]
14pub struct Provider(pub CompactString);
15
16#[property(MetaField, State, key = "status")]
17#[derive(Copy, Eq)]
18#[serde(rename_all = "snake_case")]
19pub enum EntityStatus {
20    /// The entity is online but its data may not yet be valid
21    Init,
22    /// The entity is online and its data is valid
23    Online,
24    /// The entity disconnected cleanly
25    Disconnected,
26    /// The entity was unexpectedly disconnected and its data may not be valid
27    Lost,
28}
29
30#[property(MetaField, State, key = "version")]
31pub struct Version(pub i32);