Skip to main content

FileLog

Struct FileLog 

Source
pub struct FileLog { /* private fields */ }

Implementations§

Source§

impl FileLog

Source

pub fn try_writer_fence(&self) -> Result<FileLogWriterFence, ActorError>

Fail fast before a second instance can enter an original synchronous write.

Source

pub fn try_run_owner( &self, thread_id: &str, ) -> Result<FileLogRunOwnerFence, ActorError>

Pin one original logical thread through its existing RunAdmissionLease.

Source§

impl FileLog

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Debug for FileLog

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl LogStore for FileLog

Source§

fn read(&self, thread_id: &str) -> Result<Vec<Fact>, ActorError>

Source§

fn append( &self, thread_id: &str, facts: &[NewFact], cause: Option<&str>, ) -> Result<Vec<Fact>, ActorError>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.