pub struct ChoiceGraph {
pub nodes: Vec<ChoiceGraphNode>,
pub edges: Vec<(usize, usize)>,
pub start_idx: usize,
pub end_idx: usize,
}Expand description
Validated Choice Graph (paper Definition 1).
Fields§
§nodes: Vec<ChoiceGraphNode>§edges: Vec<(usize, usize)>§start_idx: usize§end_idx: usizeImplementations§
Source§impl ChoiceGraph
impl ChoiceGraph
Sourcepub fn new(
nodes: Vec<ChoiceGraphNode>,
edges: Vec<(usize, usize)>,
) -> Result<Self, ChoiceGraphError>
pub fn new( nodes: Vec<ChoiceGraphNode>, edges: Vec<(usize, usize)>, ) -> Result<Self, ChoiceGraphError>
Construct and validate per Definition 1.
Auto-discovers start_idx / end_idx from the nodes vec.
pub fn successors(&self, node_idx: usize) -> Vec<usize>
pub fn predecessors(&self, node_idx: usize) -> Vec<usize>
Sourcepub fn has_empty_path(&self) -> bool
pub fn has_empty_path(&self) -> bool
True iff there is a direct Start→End edge (the empty path).
Trait Implementations§
Source§impl Clone for ChoiceGraph
impl Clone for ChoiceGraph
Source§fn clone(&self) -> ChoiceGraph
fn clone(&self) -> ChoiceGraph
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ChoiceGraph
impl Debug for ChoiceGraph
Source§impl<'de> Deserialize<'de> for ChoiceGraph
impl<'de> Deserialize<'de> for ChoiceGraph
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 ChoiceGraph
impl PartialEq for ChoiceGraph
Source§fn eq(&self, other: &ChoiceGraph) -> bool
fn eq(&self, other: &ChoiceGraph) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ChoiceGraph
impl Serialize for ChoiceGraph
impl Eq for ChoiceGraph
impl StructuralPartialEq for ChoiceGraph
Auto Trait Implementations§
impl Freeze for ChoiceGraph
impl RefUnwindSafe for ChoiceGraph
impl Send for ChoiceGraph
impl Sync for ChoiceGraph
impl Unpin for ChoiceGraph
impl UnsafeUnpin for ChoiceGraph
impl UnwindSafe for ChoiceGraph
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.