view rust/hg-core/src/transaction.rs @ 52164:e01e84e5e426

rust-revlog: add a Rust-only `InnerRevlog` This mirrors the Python `InnerRevlog` and will be used in a future patch to replace said Python implementation. This allows us to start doing more things in pure Rust, in particular reading and writing operations. A lot of changes have to be introduced all at once, it wouldn't be very useful to separate this patch IMO since all of them are either interlocked or only useful with the rest.
author Raphaël Gomès <rgomes@octobus.net>
date Thu, 10 Oct 2024 10:34:51 +0200
parents
children
line wrap: on
line source

use std::path::Path;

/// The Mercurial transaction system is based on the append-only nature
/// of its core files. This exposes the necessary methods to safely write to
/// the different core datastructures.
pub trait Transaction {
    /// Record the state of an append-only file before update
    fn add(&mut self, file: impl AsRef<Path>, offset: usize);

    // TODO the rest of the methods once we do more in Rust.
}