pub struct ReplayError { /* private fields */ }Available on crate feature
journal only.Expand description
An error returned by InMemoryJournal::replay.
§Examples
use ready_active_safe::journal::{ReplayError, ReplayMismatch};
let err = ReplayError::new(3, ReplayMismatch::ToMode);
assert_eq!(err.step(), 3);
assert_eq!(err.mismatch(), ReplayMismatch::ToMode);
assert_eq!(
err.to_string(),
"replay diverged at step 3: computed next mode differs from recorded mode",
);Implementations§
Source§impl ReplayError
impl ReplayError
Sourcepub const fn new(step: usize, mismatch: ReplayMismatch) -> Self
pub const fn new(step: usize, mismatch: ReplayMismatch) -> Self
Creates a new replay error.
Sourcepub const fn mismatch(&self) -> ReplayMismatch
pub const fn mismatch(&self) -> ReplayMismatch
Returns the kind of mismatch encountered.
Trait Implementations§
Source§impl Clone for ReplayError
impl Clone for ReplayError
Source§fn clone(&self) -> ReplayError
fn clone(&self) -> ReplayError
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 ReplayError
impl Debug for ReplayError
Source§impl Display for ReplayError
impl Display for ReplayError
Source§impl Error for ReplayError
impl Error for ReplayError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for ReplayError
impl PartialEq for ReplayError
impl Eq for ReplayError
impl StructuralPartialEq for ReplayError
Auto Trait Implementations§
impl Freeze for ReplayError
impl RefUnwindSafe for ReplayError
impl Send for ReplayError
impl Sync for ReplayError
impl Unpin for ReplayError
impl UnsafeUnpin for ReplayError
impl UnwindSafe for ReplayError
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