pub struct MachineGraph<S: 'static, T: 'static> {
pub machine: MachineDescriptor,
pub states: &'static [StateDescriptor<S>],
pub transitions: TransitionInventory<S, T>,
}Expand description
Structural machine graph emitted from macro-generated metadata.
Fields§
§machine: MachineDescriptorRust-facing identity of the machine family.
states: &'static [StateDescriptor<S>]All states known to the machine.
transitions: TransitionInventory<S, T>All transition sites known to the machine.
Implementations§
Source§impl<S, T> MachineGraph<S, T>
impl<S, T> MachineGraph<S, T>
Sourcepub fn state(&self, id: S) -> Option<&StateDescriptor<S>>
pub fn state(&self, id: S) -> Option<&StateDescriptor<S>>
Finds a state descriptor by id.
Sourcepub fn transition(&self, id: T) -> Option<&TransitionDescriptor<S, T>>
pub fn transition(&self, id: T) -> Option<&TransitionDescriptor<S, T>>
Finds a transition descriptor by id.
Sourcepub fn transitions_from(
&self,
state: S,
) -> impl Iterator<Item = &TransitionDescriptor<S, T>> + '_
pub fn transitions_from( &self, state: S, ) -> impl Iterator<Item = &TransitionDescriptor<S, T>> + '_
Yields all transition sites originating from state.
Sourcepub fn transition_from_method(
&self,
state: S,
method_name: &str,
) -> Option<&TransitionDescriptor<S, T>>
pub fn transition_from_method( &self, state: S, method_name: &str, ) -> Option<&TransitionDescriptor<S, T>>
Finds the transition site for method_name on state.
Sourcepub fn transitions_named<'a>(
&'a self,
method_name: &'a str,
) -> impl Iterator<Item = &'a TransitionDescriptor<S, T>> + 'a
pub fn transitions_named<'a>( &'a self, method_name: &'a str, ) -> impl Iterator<Item = &'a TransitionDescriptor<S, T>> + 'a
Yields all transition sites that share the same method name.
Sourcepub fn legal_targets(&self, id: T) -> Option<&'static [S]>
pub fn legal_targets(&self, id: T) -> Option<&'static [S]>
Returns the exact legal target states for a transition site.
Trait Implementations§
Source§impl<S: Clone + 'static, T: Clone + 'static> Clone for MachineGraph<S, T>
impl<S: Clone + 'static, T: Clone + 'static> Clone for MachineGraph<S, T>
Source§fn clone(&self) -> MachineGraph<S, T>
fn clone(&self) -> MachineGraph<S, T>
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 moreimpl<S: Copy + 'static, T: Copy + 'static> Copy for MachineGraph<S, T>
impl<S: Eq + 'static, T: Eq + 'static> Eq for MachineGraph<S, T>
impl<S: 'static, T: 'static> StructuralPartialEq for MachineGraph<S, T>
Auto Trait Implementations§
impl<S, T> Freeze for MachineGraph<S, T>
impl<S, T> RefUnwindSafe for MachineGraph<S, T>where
S: RefUnwindSafe,
impl<S, T> Send for MachineGraph<S, T>where
S: Sync,
impl<S, T> Sync for MachineGraph<S, T>where
S: Sync,
impl<S, T> Unpin for MachineGraph<S, T>
impl<S, T> UnsafeUnpin for MachineGraph<S, T>
impl<S, T> UnwindSafe for MachineGraph<S, T>where
S: RefUnwindSafe,
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