pub struct Session { /* private fields */ }Expand description
An open or recoverable session on disk.
Implementations§
Source§impl Session
impl Session
Sourcepub fn content_dir(&self) -> PathBuf
pub fn content_dir(&self) -> PathBuf
The directory the content file sits in, and the one to watch. Concept 6.1 reads anything else appearing here as the target application’s work.
Sourcepub fn content_path(&self) -> PathBuf
pub fn content_path(&self) -> PathBuf
The content file 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 content file is this, and that it is what this session’s content file 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.