pub struct Session { /* private fields */ }Expand description
An open or recoverable session on disk.
Implementations§
Source§impl Session
impl Session
Sourcepub fn payload_dir(&self) -> PathBuf
pub fn payload_dir(&self) -> PathBuf
The directory the payload sits in, and the one to watch. Concept 6.1 reads anything else appearing here as the target application’s work.
Sourcepub fn payload_path(&self) -> PathBuf
pub fn payload_path(&self) -> PathBuf
The payload itself.
Sourcepub fn note_write_back(&mut self) -> Result<()>
pub fn note_write_back(&mut self) -> Result<()>
Count a write-back, and write that down before returning.
Persisted rather than held, because the number is only worth anything to a session that crashed, and a count kept in memory is a count lost by the event it exists to describe.
§Errors
Where the record cannot be rewritten.
Sourcepub fn note_agreement(&mut self, crc: u32) -> Result<()>
pub fn note_agreement(&mut self, crc: u32) -> Result<()>
Write down that the container’s payload is this, and that it is what this session’s payload came from or was last put into.
Called at the two moments the two sides are made to agree: the
extraction, and the commit of a write-back. Nowhere else — a value
recorded at any other moment would be recording an agreement that was
never established, which is the one way Record::agreed could tell a
lie rather than simply not know.
§Errors
Where the record cannot be rewritten.