pub struct PersistentFSM<S, D, C, E, Err>where
S: Clone + Send + 'static,
D: Send + 'static,
C: Send + 'static,
E: Clone + Send + 'static,
Err: Error + Send + 'static,{ /* private fields */ }Implementations§
Source§impl<S, D, C, E, Err> PersistentFSM<S, D, C, E, Err>
impl<S, D, C, E, Err> PersistentFSM<S, D, C, E, Err>
pub fn new(persistence_id: impl Into<String>) -> Self
pub fn with_initial(self, s: S, d: D) -> Self
pub fn on_command<F>(self, f: F) -> Self
pub fn on_event<F>(self, f: F) -> Self
pub fn with_codec<EncF, DecF>(self, encode: EncF, decode: DecF) -> Self
pub fn state(&self) -> Option<&S>
pub fn data(&self) -> Option<&D>
Sourcepub fn transitions(&self) -> &[(S, S)]
pub fn transitions(&self) -> &[(S, S)]
History of state transitions seen since boot. Useful for tests.
pub async fn recover<J: Journal>( &mut self, journal: Arc<J>, permitter: &RecoveryPermitter, ) -> Result<u64, EventsourcedError<Err>>
pub async fn handle<J: Journal>( &mut self, journal: Arc<J>, cmd: C, ) -> Result<(), EventsourcedError<Err>>
Auto Trait Implementations§
impl<S, D, C, E, Err> Freeze for PersistentFSM<S, D, C, E, Err>
impl<S, D, C, E, Err> !RefUnwindSafe for PersistentFSM<S, D, C, E, Err>
impl<S, D, C, E, Err> Send for PersistentFSM<S, D, C, E, Err>
impl<S, D, C, E, Err> !Sync for PersistentFSM<S, D, C, E, Err>
impl<S, D, C, E, Err> Unpin for PersistentFSM<S, D, C, E, Err>
impl<S, D, C, E, Err> UnsafeUnpin for PersistentFSM<S, D, C, E, Err>where
S: UnsafeUnpin,
D: UnsafeUnpin,
impl<S, D, C, E, Err> !UnwindSafe for PersistentFSM<S, D, C, E, Err>
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