pub struct SimpleStateImplementation<'a, K, Id, D, E>where
D: KeyProvidingData<K>,
Id: Copy,{ /* private fields */ }
Expand description
AutomatonState implementating struct which simplifies state definition by managing list of defined connections. Depends on data for providing next key. This key is then used to match a connection from the defined list. Each state has an assigned identifier which is used to inform which state did the automaton stop on. Identifier is copied to the result meaning it has to implement the Copy trait.
Implementations§
Source§impl<'a, K, Id, D, E> SimpleStateImplementation<'a, K, Id, D, E>where
D: KeyProvidingData<K>,
Id: Copy,
impl<'a, K, Id, D, E> SimpleStateImplementation<'a, K, Id, D, E>where
D: KeyProvidingData<K>,
Id: Copy,
Sourcepub fn new(id: Id) -> Self
pub fn new(id: Id) -> Self
Creates new simple state with provided identifier.
id
- Identifier of this state which will be copied into result when automaton stops on this state.
Sourcepub fn register_connection(
&mut self,
connection: SimpleInterStateConnection<'a, K, Id, D, E>,
)
pub fn register_connection( &mut self, connection: SimpleInterStateConnection<'a, K, Id, D, E>, )
Adds connection to possible next states of current state.
Trait Implementations§
Source§impl<'a, K, Id, D, E> AutomatonState<'a, Id, D, E> for SimpleStateImplementation<'a, K, Id, D, E>where
D: KeyProvidingData<K>,
Id: Copy,
impl<'a, K, Id, D, E> AutomatonState<'a, Id, D, E> for SimpleStateImplementation<'a, K, Id, D, E>where
D: KeyProvidingData<K>,
Id: Copy,
Source§fn get_id_owned(&self) -> Id
fn get_id_owned(&self) -> Id
Returns owned copy of identifier of this state.
Auto Trait Implementations§
impl<'a, K, Id, D, E> Freeze for SimpleStateImplementation<'a, K, Id, D, E>where
Id: Freeze,
impl<'a, K, Id, D, E> !RefUnwindSafe for SimpleStateImplementation<'a, K, Id, D, E>
impl<'a, K, Id, D, E> !Send for SimpleStateImplementation<'a, K, Id, D, E>
impl<'a, K, Id, D, E> !Sync for SimpleStateImplementation<'a, K, Id, D, E>
impl<'a, K, Id, D, E> Unpin for SimpleStateImplementation<'a, K, Id, D, E>
impl<'a, K, Id, D, E> !UnwindSafe for SimpleStateImplementation<'a, K, Id, D, E>
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