add a Replica

This commit is contained in:
Dustin J. Mitchell
2020-01-01 18:22:01 -05:00
parent f6ffcc7039
commit b898ec1fde
3 changed files with 103 additions and 3 deletions

View File

@@ -39,9 +39,9 @@ impl DB {
}
}
/// Apply an operation to the DB. Aside from synchronization operations, this
/// is the only way to modify the DB. In cases where an operation does not
/// make sense, this function will ignore the operation.
/// Apply an operation to the DB. Aside from synchronization operations, this is the only way
/// to modify the DB. In cases where an operation does not make sense, this function will do
/// nothing and return an error (but leave the DB in a consistent state).
pub fn apply(&mut self, op: Operation) -> Result<(), Error> {
if let err @ Err(_) = self.apply_op(&op) {
return err;