| 1 | use loro_common::ContainerID; |
| 2 | |
| 3 | use crate::{container::idx::ContainerIdx, event::InternalDiff, OpLog}; |
| 4 | |
| 5 | use super::{DiffCalcVersionInfo, DiffCalculatorTrait, DiffMode}; |
| 6 | |
| 7 | #[derive(Debug, Default)] |
| 8 | pub struct UnknownDiffCalculator; |
| 9 | |
| 10 | impl DiffCalculatorTrait for UnknownDiffCalculator { |
| 11 | fn start_tracking(&mut self, _oplog: &OpLog, _vv: &crate::VersionVector, _mode: DiffMode) {} |
| 12 | |
| 13 | fn apply_change( |
| 14 | &mut self, |
| 15 | _oplog: &OpLog, |
| 16 | _op: crate::op::RichOp, |
| 17 | _vv: Option<&crate::VersionVector>, |
| 18 | ) { |
| 19 | } |
| 20 | |
| 21 | fn finish_this_round(&mut self) {} |
| 22 | |
| 23 | fn calculate_diff( |
| 24 | &mut self, |
| 25 | _idx: ContainerIdx, |
| 26 | _oplog: &OpLog, |
| 27 | _info: DiffCalcVersionInfo, |
| 28 | _on_new_container: impl FnMut(&ContainerID), |
| 29 | ) -> (InternalDiff, DiffMode) { |
| 30 | (InternalDiff::Unknown, DiffMode::Checkout) |
| 31 | } |
| 32 | } |