Remove all data past the given transaction `offset`. The function deletes log segments starting from the newest. As multiple segments cannot be deleted atomically, the log may be left longer than `offset` if the function does not return successfully. If the function returns successfully, the most recent [`Commit`] in the log will contain the transaction at `offset`. The log must be re-opened if
(repo: &impl Repo, offset: u64)
| 698 | /// |
| 699 | /// The log must be re-opened if it is to be used after calling this function. |
| 700 | pub fn reset_to(repo: &impl Repo, offset: u64) -> io::Result<()> { |
| 701 | let segments = repo.existing_offsets()?; |
| 702 | reset_to_internal(repo, &segments, offset) |
| 703 | } |
| 704 | |
| 705 | fn reset_to_internal(repo: &impl Repo, segments: &[u64], offset: u64) -> io::Result<()> { |
| 706 | for segment in segments.iter().copied().rev() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…