grass_runtime/property/
tag.rs

1use std::fmt::Display;
2
3pub trait Tagged<T: Clone = i64> {
4    fn tag(&self) -> Option<T> {
5        None
6    }
7    fn tag_str(&self) -> String
8    where
9        T: Display,
10    {
11        if let Some(val) = self.tag() {
12            format!("{}", val)
13        } else {
14            return ".".to_string();
15        }
16    }
17}