pub struct LogStore { /* private fields */ }Implementations§
Source§impl LogStore
impl LogStore
pub fn new() -> LogStore
pub async fn create_session_log(&self, session_id: &str)
pub async fn append(&self, session_id: &str, entry: LogEntry)
pub async fn get_log(&self, session_id: &str) -> Option<Vec<LogEntry>>
Sourcepub async fn get_incoming_after(
&self,
session_id: &str,
after_sequence: u64,
) -> Result<Vec<(u64, LogEntry)>, u64>
pub async fn get_incoming_after( &self, session_id: &str, after_sequence: u64, ) -> Result<Vec<(u64, LogEntry)>, u64>
Returns accepted (Incoming) log entries strictly after after_sequence,
paired with their 1-based accepted-envelope ordinal.
Sequence contract (RFC-MACP-0006 §3.2): the per-session sequence is the
ordinal of accepted session envelopes — the first accepted envelope
(SessionStart) is 1. after_sequence is EXCLUSIVE: 0 replays from
the start, n resumes after the n-th accepted envelope. Internal and
Checkpoint entries never consume ordinals, so client-visible sequences
are contiguous and stable regardless of interleaved internal records.
(The previous implementation compared against the raw combined log
index inclusively — non-contiguous, shifting with internal entries,
and off by one against the RFC’s after_sequence + 1 replay rule.)
Sourcepub async fn remove_session_log(&self, session_id: &str)
pub async fn remove_session_log(&self, session_id: &str)
Drop a session’s in-memory log (eviction). The durable log remains in storage; a later restart replays it if needed.
Sourcepub async fn replace_session_log(
&self,
session_id: &str,
entries: Vec<LogEntry>,
)
pub async fn replace_session_log( &self, session_id: &str, entries: Vec<LogEntry>, )
Replace a session’s in-memory log wholesale — used by compaction so memory and storage stay in step (previously only disk was rewritten, leaving divergent in-memory history until restart).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for LogStore
impl !RefUnwindSafe for LogStore
impl !UnwindSafe for LogStore
impl Send for LogStore
impl Sync for LogStore
impl Unpin for LogStore
impl UnsafeUnpin for LogStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request