pub struct FileLog { /* private fields */ }Implementations§
Source§impl FileLog
impl FileLog
Sourcepub fn try_writer_fence(&self) -> Result<FileLogWriterFence, ActorError>
pub fn try_writer_fence(&self) -> Result<FileLogWriterFence, ActorError>
Fail fast before a second instance can enter an original synchronous write.
Sourcepub fn try_run_owner(
&self,
thread_id: &str,
) -> Result<FileLogRunOwnerFence, ActorError>
pub fn try_run_owner( &self, thread_id: &str, ) -> Result<FileLogRunOwnerFence, ActorError>
Pin one original logical thread through its existing RunAdmissionLease.
Source§impl FileLog
impl FileLog
Sourcepub fn open(dir: impl AsRef<Path>) -> Result<Self, ActorError>
pub fn open(dir: impl AsRef<Path>) -> Result<Self, ActorError>
Ambient constructor for a caller-owned location. The caller owns the
parent path’s authority. Hosts resolving untrusted workspace components
must instead pass their already validated handle to from_directory.
Sourcepub fn from_directory(dir: Dir) -> Result<Self, ActorError>
pub fn from_directory(dir: Dir) -> Result<Self, ActorError>
Bind all operations to an already authorized directory handle. This activation constructor does not create a directory or resolve an ambient path. It tightens permissions through the handle on Unix.
Sourcepub fn truncate_after(
&self,
thread_id: &str,
seq: u64,
) -> Result<usize, ActorError>
pub fn truncate_after( &self, thread_id: &str, seq: u64, ) -> Result<usize, ActorError>
Discard every fact after seq, keeping the retained prefix.
The retained prefix is written to a sibling scratch file, flushed, and atomically renamed over the thread’s log, so a crash leaves either the complete old log or the complete truncated one — never a partial line. A parse failure or an absent thread removes nothing. Returns how many facts were removed; a cut at or beyond the last seq removes nothing and leaves the file untouched, so repeating a cut is free.