Trait cedar_policy_core::transitive_closure::TCNode

source ·
pub trait TCNode<K> {
    // Required methods
    fn get_key(&self) -> K;
    fn add_edge_to(&mut self, k: K);
    fn out_edges(&self) -> Box<dyn Iterator<Item = &K> + '_>;
    fn has_edge_to(&self, k: &K) -> bool;
}
Expand description

Trait used to generalize transitive closure computation. This trait should be implemented for types representing a node in the hierarchy (e.g., the entity hierarchy) where we need to compute the transitive closure of the hierarchy starting from only direct adjacencies. This trait is parametrized by a type K which represents a unique identifier for graph nodes.

Required Methods§

source

fn get_key(&self) -> K

Extract a unique identifier for the node.

source

fn add_edge_to(&mut self, k: K)

Add an edge out off this node to the node with key k.

source

fn out_edges(&self) -> Box<dyn Iterator<Item = &K> + '_>

Retrieve an iterator for the edges out of this node.

source

fn has_edge_to(&self, k: &K) -> bool

Return true when their is an edge between this node and the node with key k.

Implementors§