pub struct TaxonomyTerm {
pub id: TermId,
pub label: String,
pub category: Option<TermId>,
pub description: String,
pub attributes: Vec<(String, String)>,
}Expand description
A single term in some taxonomy: a stable id, a human label, an optional grouping category (a coarser term id), and an open attribute bag for ABAC / ontological axioms.
Fields§
§id: TermId§label: String§category: Option<TermId>Grouping/parent term id (a facet or category). None for top-level facets/categories.
description: String§attributes: Vec<(String, String)>Extensible axioms: ("sphere","selfhood"), ("domains","health,welfare"),
("facet","temporal"), jurisdiction hints, etc. Attribute keys are open by design.
Implementations§
Source§impl TaxonomyTerm
impl TaxonomyTerm
Sourcepub fn in_category(self, category: impl Into<TermId>) -> Self
pub fn in_category(self, category: impl Into<TermId>) -> Self
true when in the category.
Sourcepub fn with_attr(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn with_attr(self, key: impl Into<String>, value: impl Into<String>) -> Self
Builder — sets attr.
Trait Implementations§
Source§impl Clone for TaxonomyTerm
impl Clone for TaxonomyTerm
Source§impl Debug for TaxonomyTerm
impl Debug for TaxonomyTerm
Source§impl<'de> Deserialize<'de> for TaxonomyTerm
impl<'de> Deserialize<'de> for TaxonomyTerm
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TaxonomyTerm
Source§impl PartialEq for TaxonomyTerm
impl PartialEq for TaxonomyTerm
Source§impl Serialize for TaxonomyTerm
impl Serialize for TaxonomyTerm
impl StructuralPartialEq for TaxonomyTerm
Auto Trait Implementations§
impl Freeze for TaxonomyTerm
impl RefUnwindSafe for TaxonomyTerm
impl Send for TaxonomyTerm
impl Sync for TaxonomyTerm
impl Unpin for TaxonomyTerm
impl UnsafeUnpin for TaxonomyTerm
impl UnwindSafe for TaxonomyTerm
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more