pub struct StateGraph {
pub states: Vec<State>,
pub transitions: Vec<Transition>,
pub initial_state: Option<String>,
}Expand description
The Semantic State Graph
Fields§
§states: Vec<State>All states in the graph
transitions: Vec<Transition>All transitions between states
initial_state: Option<String>Initial state ID
Implementations§
Source§impl StateGraph
impl StateGraph
Sourcepub fn is_deterministic(&self) -> bool
pub fn is_deterministic(&self) -> bool
Check if the graph is deterministic (no ambiguous transitions)
Sourcepub fn reachable_states(&self) -> Vec<&State>
pub fn reachable_states(&self) -> Vec<&State>
Find all states reachable from the initial state
Trait Implementations§
Source§impl Clone for StateGraph
impl Clone for StateGraph
Source§fn clone(&self) -> StateGraph
fn clone(&self) -> StateGraph
Returns a duplicate of the value. Read more
1.0.0 · 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 StateGraph
impl Debug for StateGraph
Source§impl Default for StateGraph
impl Default for StateGraph
Source§impl<'de> Deserialize<'de> for StateGraph
impl<'de> Deserialize<'de> for StateGraph
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
Auto Trait Implementations§
impl Freeze for StateGraph
impl RefUnwindSafe for StateGraph
impl Send for StateGraph
impl Sync for StateGraph
impl Unpin for StateGraph
impl UnwindSafe for StateGraph
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