-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
//! Contains the types necessary for Optimistic Locking through versioning. | ||
/// A version used for Optimistic Locking. | ||
/// | ||
/// Used by the [crate::aggregate::Root] to avoid concurrency issues, | ||
Check warning on line 5 in eventually/src/version.rs GitHub Actions / clippyitem in documentation is missing backticks
Check warning on line 5 in eventually/src/version.rs GitHub Actions / clippyitem in documentation is missing backticks
Check warning on line 5 in eventually/src/version.rs GitHub Actions / clippyitem in documentation is missing backticks
|
||
/// and [crate::event::Store] to implement stream-local ordering to the messages. | ||
Check warning on line 6 in eventually/src/version.rs GitHub Actions / clippyitem in documentation is missing backticks
Check warning on line 6 in eventually/src/version.rs GitHub Actions / clippyitem in documentation is missing backticks
Check warning on line 6 in eventually/src/version.rs GitHub Actions / clippyitem in documentation is missing backticks
|
||
pub type Version = u64; | ||
|
||
/// This error is returned by a function when a version conflict error has | ||
/// been detected. | ||
#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)] | ||
#[error("conflict error detected, expected version was: {expected}, found: {actual}")] | ||
pub struct ConflictError { | ||
/// The [Version] value that was expected when calling the function that failed. | ||
pub expected: Version, | ||
|
||
/// The actual [Version] value, which mismatch caused this error. | ||
pub actual: Version, | ||
} |