pub struct CapabilityGraph { /* private fields */ }
Expand description
Capability graph manager for tracking nested capability relationships
Implementations§
Source§impl CapabilityGraph
impl CapabilityGraph
Sourcepub async fn add_capability(
&self,
node: CapabilityNode,
) -> Result<(), CapabilityError>
pub async fn add_capability( &self, node: CapabilityNode, ) -> Result<(), CapabilityError>
Add a capability to the graph
Sourcepub async fn get_capability(&self, id: &str) -> Option<CapabilityNode>
pub async fn get_capability(&self, id: &str) -> Option<CapabilityNode>
Get a capability node
Sourcepub async fn get_children(&self, parent_id: &str) -> Vec<String>
pub async fn get_children(&self, parent_id: &str) -> Vec<String>
Get children of a capability
Sourcepub async fn get_descendants(&self, parent_id: &str) -> Vec<String>
pub async fn get_descendants(&self, parent_id: &str) -> Vec<String>
Get all descendants (recursive children) of a capability
Sourcepub async fn add_reference(&self, id: &str) -> Result<usize, CapabilityError>
pub async fn add_reference(&self, id: &str) -> Result<usize, CapabilityError>
Increment reference count
Sourcepub async fn remove_reference(&self, id: &str) -> Result<bool, CapabilityError>
pub async fn remove_reference(&self, id: &str) -> Result<bool, CapabilityError>
Decrement reference count and remove if zero
Sourcepub async fn remove_capability(&self, id: &str) -> Result<(), CapabilityError>
pub async fn remove_capability(&self, id: &str) -> Result<(), CapabilityError>
Remove a capability and its descendants
Sourcepub async fn get_stats(&self) -> CapabilityGraphStats
pub async fn get_stats(&self) -> CapabilityGraphStats
Get graph statistics
Trait Implementations§
Source§impl Debug for CapabilityGraph
impl Debug for CapabilityGraph
Auto Trait Implementations§
impl Freeze for CapabilityGraph
impl !RefUnwindSafe for CapabilityGraph
impl Send for CapabilityGraph
impl Sync for CapabilityGraph
impl Unpin for CapabilityGraph
impl !UnwindSafe for CapabilityGraph
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