pub struct CweMappingNode {
pub id: String,
pub cwe: Option<Vec<CweId>>,
pub children: Vec<CweMappingNode>,
}Expand description
A node in the VRT to CWE mapping tree
This represents either a leaf mapping or a parent node with children. Each node maps a VRT ID to zero or more CWE IDs.
Fields§
§id: StringVRT identifier (e.g., “cross_site_scripting_xss”)
cwe: Option<Vec<CweId>>Associated CWE identifiers (e.g., [“CWE-79”]) Can be null if no CWE mapping exists for this VRT ID
children: Vec<CweMappingNode>Child mappings (for hierarchical structure)
Implementations§
Source§impl CweMappingNode
impl CweMappingNode
Sourcepub fn has_cwe_mapping(&self) -> bool
pub fn has_cwe_mapping(&self) -> bool
Returns true if this node has CWE mappings
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, vrt_id: &str) -> Option<&CweMappingNode>
pub fn find_by_id(&self, vrt_id: &str) -> Option<&CweMappingNode>
Recursively finds a mapping node by VRT ID
Sourcepub fn cwe_ids(&self) -> Vec<&CweId>
pub fn cwe_ids(&self) -> Vec<&CweId>
Returns all CWE IDs associated with this node (non-recursive)
Sourcepub fn all_cwe_ids(&self) -> Vec<&CweId>
pub fn all_cwe_ids(&self) -> Vec<&CweId>
Returns all CWE IDs in the subtree rooted at this node (recursive)
Sourcepub fn leaf_nodes(&self) -> Vec<&CweMappingNode>
pub fn leaf_nodes(&self) -> Vec<&CweMappingNode>
Returns all leaf nodes (nodes with CWE mappings but no children)
Trait Implementations§
Source§impl Clone for CweMappingNode
impl Clone for CweMappingNode
Source§fn clone(&self) -> CweMappingNode
fn clone(&self) -> CweMappingNode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CweMappingNode
impl Debug for CweMappingNode
Source§impl<'de> Deserialize<'de> for CweMappingNode
impl<'de> Deserialize<'de> for CweMappingNode
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
Source§impl PartialEq for CweMappingNode
impl PartialEq for CweMappingNode
Source§impl Serialize for CweMappingNode
impl Serialize for CweMappingNode
impl StructuralPartialEq for CweMappingNode
Auto Trait Implementations§
impl Freeze for CweMappingNode
impl RefUnwindSafe for CweMappingNode
impl Send for CweMappingNode
impl Sync for CweMappingNode
impl Unpin for CweMappingNode
impl UnwindSafe for CweMappingNode
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