The digest of `state`'s effective perspective: the view and each view in [`sandbox_view_chain`], by id, scope, own Merkle state and change count. The view's own Merkle state is not enough to fence a draft: a change landing on an ancestor moves what the draft sees without touching its own log. Every input here is a row a sandbox's cache holds verbatim (the skeleton carries the view and its ancesto
(
txn: &atomic_core::pristine::ReadTxn,
state: &atomic_core::pristine::ViewState,
)
| 415 | /// skeleton carries the view and its ancestors as themselves), so the cache |
| 416 | /// computes the same digest from its own pristine. |
| 417 | fn effective_state( |
| 418 | txn: &atomic_core::pristine::ReadTxn, |
| 419 | state: &atomic_core::pristine::ViewState, |
| 420 | ) -> Result<Hash, RepositoryError> { |
| 421 | let mut bytes = b"atomic.sandbox.effective-view.v1".to_vec(); |
| 422 | for view in std::iter::once(state.clone()).chain(sandbox_view_chain(txn, state)?) { |
| 423 | // Hash input only, never stored or sorted. |
| 424 | bytes.extend_from_slice(&view.id.to_le_bytes()); |
| 425 | bytes.push(view.kind as u8); |
| 426 | bytes.extend_from_slice(view.state.as_bytes()); |
| 427 | bytes.extend_from_slice(&view.change_count.to_le_bytes()); |
| 428 | } |
| 429 | Ok(Hash::of(&bytes)) |
| 430 | } |
| 431 | |
| 432 | impl Repository { |
| 433 | /// The visible change ids of `view`, sorted. |
no test coverage detected