Struct emergent::decision_makers::machinery::MachineryState
source · pub struct MachineryState<M = (), K = DefaultKey> { /* private fields */ }
Expand description
Defines machinery state with task to run and changes that can happen for this state.
Implementations§
source§impl<M, K> MachineryState<M, K>
impl<M, K> MachineryState<M, K>
sourcepub fn new<T>(task: T, changes: Vec<MachineryChange<M, K>>) -> Selfwhere
T: Task<M> + 'static,
pub fn new<T>(task: T, changes: Vec<MachineryChange<M, K>>) -> Selfwhere
T: Task<M> + 'static,
Constructs new state with task and list of changes.
sourcepub fn new_raw(
task: Box<dyn Task<M>>,
changes: Vec<MachineryChange<M, K>>
) -> Self
pub fn new_raw( task: Box<dyn Task<M>>, changes: Vec<MachineryChange<M, K>> ) -> Self
Constructs new state with task and list of changes.
sourcepub fn change(self, change: MachineryChange<M, K>) -> Self
pub fn change(self, change: MachineryChange<M, K>) -> Self
Add state change.
Trait Implementations§
Auto Trait Implementations§
impl<M = (), K = String> !RefUnwindSafe for MachineryState<M, K>
impl<M, K> Send for MachineryState<M, K>where
K: Send,
impl<M, K> Sync for MachineryState<M, K>where
K: Sync,
impl<M, K> Unpin for MachineryState<M, K>where
K: Unpin,
impl<M = (), K = String> !UnwindSafe for MachineryState<M, K>
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