cedar_policy_core::transitive_closure

Trait 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.

Implementations on Foreign Types§

Source§

impl TCNode<EntityUID> for Arc<Entity>

Source§

fn get_key(&self) -> EntityUID

Source§

fn add_edge_to(&mut self, k: EntityUID)

Source§

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

Source§

fn has_edge_to(&self, e: &EntityUID) -> bool

Implementors§