Trait flow_arena::prelude::FlowBase[][src]

pub trait FlowBase {
    type Id: Default + Clone + Hash + Eq;
    type Node: Default + Clone + Node<Self::Id>;
Show methods fn orphan(&self) -> Vec<Self::Id>;
fn node(&self, obj: &Self::Id) -> Option<&Self::Node>;
fn node_mut(&mut self, obj: &Self::Id) -> Option<&mut Self::Node>; fn contains_node(&self, obj: &Self::Id) -> bool { ... }
fn parent(&self, obj: &Self::Id) -> Option<Self::Id> { ... }
fn children(&self, obj: &Self::Id) -> Vec<Self::Id> { ... }
fn friends(&self, obj: &Self::Id) -> Vec<Self::Id> { ... }
fn nth_friend(&self, obj: &Self::Id) -> Option<usize> { ... }
fn children_owned(&self, obj: &Self::Id) -> Vec<Self::Id> { ... }
fn is_owned(&self, obj: &Self::Id, owner: &Self::Id) -> bool { ... }
fn is_linked(&self, obj: &Self::Id, owner: &Self::Id) -> bool { ... }
fn node_offspring_set(&self, obj: &Self::Id) -> HashSet<Self::Id> { ... }
fn node_ownership_set(&self, obj: &Self::Id) -> HashSet<Self::Id> { ... }
}

provides basic node-reflection abiliy; no check

Associated Types

type Id: Default + Clone + Hash + Eq[src]

type Node: Default + Clone + Node<Self::Id>[src]

Loading content...

Required methods

fn orphan(&self) -> Vec<Self::Id>[src]

ensures root and returns it

fn node(&self, obj: &Self::Id) -> Option<&Self::Node>[src]

fn node_mut(&mut self, obj: &Self::Id) -> Option<&mut Self::Node>[src]

Loading content...

Provided methods

fn contains_node(&self, obj: &Self::Id) -> bool[src]

fn parent(&self, obj: &Self::Id) -> Option<Self::Id>[src]

fn children(&self, obj: &Self::Id) -> Vec<Self::Id>[src]

fn friends(&self, obj: &Self::Id) -> Vec<Self::Id>[src]

returns parent’s children

fn nth_friend(&self, obj: &Self::Id) -> Option<usize>[src]

returns nth position in friends; None if not found in either way

fn children_owned(&self, obj: &Self::Id) -> Vec<Self::Id>[src]

returns owned children

fn is_owned(&self, obj: &Self::Id, owner: &Self::Id) -> bool[src]

judge whether the obj is owned by the owner

fn is_linked(&self, obj: &Self::Id, owner: &Self::Id) -> bool[src]

judge whether the obj is purely linked from the owner

fn node_offspring_set(&self, obj: &Self::Id) -> HashSet<Self::Id>[src]

returns all the offspring of a node, not including itself

fn node_ownership_set(&self, obj: &Self::Id) -> HashSet<Self::Id>[src]

returns all the nodes owned by a node, including itself

Loading content...

Implementors

impl<Id, FlowNode> FlowBase for FlowArena<Id, FlowNode> where
    Id: Clone + Hash + Eq + Default + Debug,
    FlowNode: Node<Id> + Default + Debug + Clone
[src]

type Id = Id

type Node = FlowNode

Loading content...