| 86 | /// ``` |
| 87 | #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] |
| 88 | pub struct ApplyOptions { |
| 89 | /// Whether to validate CRDT ordering constraints. |
| 90 | /// |
| 91 | /// When enabled, the apply process verifies that insertions respect |
| 92 | /// the CRDT ordering invariants (e.g., "after" references are valid). |
| 93 | validate_ordering: bool, |
| 94 | |
| 95 | /// Whether to validate that referenced entities exist. |
| 96 | /// |
| 97 | /// When enabled, the apply process verifies that all referenced |
| 98 | /// TrunkIds, BranchIds, and LeafIds exist before operating on them. |
| 99 | validate_references: bool, |
| 100 | |
| 101 | /// Whether to track detected conflicts. |
| 102 | /// |
| 103 | /// When enabled, conflicts are recorded in the [`ApplyContext`] for |
| 104 | /// later inspection. This allows the caller to decide how to handle them. |
| 105 | /// |
| 106 | /// [`ApplyContext`]: super::context::ApplyContext |
| 107 | track_conflicts: bool, |
| 108 | |
| 109 | /// Whether to fail immediately on conflict detection. |
| 110 | /// |
| 111 | /// When enabled, the first detected conflict causes the apply to fail. |
| 112 | /// When disabled, conflicts are tracked (if `track_conflicts` is true) |
| 113 | /// and the apply continues. |
| 114 | fail_on_conflict: bool, |
| 115 | |
| 116 | /// Whether to allow duplicate CRDT IDs. |
| 117 | /// |
| 118 | /// When enabled, operations with IDs that already exist are silently |
| 119 | /// skipped (idempotent behavior). When disabled, duplicate IDs cause |
| 120 | /// an error. |
| 121 | /// |
| 122 | /// This is useful for recovery scenarios where changes might be |
| 123 | /// partially applied. |
| 124 | allow_duplicate_ids: bool, |
| 125 | |
| 126 | /// Whether to update reverse index tables. |
| 127 | /// |
| 128 | /// When enabled, reverse lookup tables (PATH_TRUNK, INODE_TRUNK) are |
| 129 | /// updated during apply. Disabling this can improve performance but |
| 130 | /// requires a separate index rebuild. |
| 131 | update_reverse_indexes: bool, |
| 132 | |
| 133 | /// Maximum number of operations to apply. |
| 134 | /// |
| 135 | /// When set, the apply process stops after this many operations. |
| 136 | /// This can be used for batched processing or to limit resource usage. |
| 137 | max_operations: Option<usize>, |
| 138 | |
| 139 | /// Whether to verify content ranges are valid. |
| 140 | /// |
| 141 | /// When enabled, content byte ranges are verified against the actual |
| 142 | /// content blob length. |
| 143 | validate_content_ranges: bool, |
| 144 | } |
| 145 |
nothing calls this directly
no outgoing calls
no test coverage detected