feat: add utility function to read an attribute value from an entity

This commit is contained in:
2025-09-27 07:56:20 +02:00
parent e274ccafec
commit 55e1b5d9cf

View File

@@ -18,4 +18,11 @@ impl O {
self.attributes.insert(attribute.id.clone(), attribute);
self
}
pub fn value_of(&self, id: &str) -> Option<&Value> {
let attribute = self.attributes.get(id);
match attribute {
None => None,
Some(attribute) => Some(&attribute.value),
}
}
}