pub struct VrtNode {
pub id: String,
pub name: String,
pub node_type: VrtNodeType,
pub children: Vec<VrtNode>,
pub priority: Option<u8>,
}Expand description
A node in the VRT taxonomy tree
The VRT is hierarchical with three levels:
- Category (top level)
- Subcategory (children of categories)
- Variant (children of subcategories, leaf nodes with priority ratings)
Fields§
§id: StringUnique identifier for this node (e.g., “prompt_injection”)
name: StringHuman-readable name (e.g., “Prompt Injection”)
node_type: VrtNodeTypeThe type of this node in the hierarchy
children: Vec<VrtNode>Child nodes (categories have subcategories, subcategories have variants) Only present for category and subcategory nodes
priority: Option<u8>Priority/severity rating (1-5, where 1 is most severe) Only present for variant nodes
Implementations§
Source§impl VrtNode
impl VrtNode
Sourcepub fn is_category(&self) -> bool
pub fn is_category(&self) -> bool
Returns true if this node is a category
Sourcepub fn is_subcategory(&self) -> bool
pub fn is_subcategory(&self) -> bool
Returns true if this node is a subcategory
Sourcepub fn is_variant(&self) -> bool
pub fn is_variant(&self) -> bool
Returns true if this node is a variant
Sourcepub fn has_children(&self) -> bool
pub fn has_children(&self) -> bool
Returns true if this node has children
Sourcepub fn find_by_id(&self, id: &str) -> Option<&VrtNode>
pub fn find_by_id(&self, id: &str) -> Option<&VrtNode>
Recursively finds a node by ID in the tree
Trait Implementations§
Source§impl<'de> Deserialize<'de> for VrtNode
impl<'de> Deserialize<'de> for VrtNode
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 StructuralPartialEq for VrtNode
Auto Trait Implementations§
impl Freeze for VrtNode
impl RefUnwindSafe for VrtNode
impl Send for VrtNode
impl Sync for VrtNode
impl Unpin for VrtNode
impl UnwindSafe for VrtNode
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