pub struct CodexHistoryTopicIndex { /* private fields */ }Expand description
Append-aware index of the stable topic records in Codex history.jsonl.
Long-lived session-list clients can retain this index and refresh it after filesystem invalidations. Ordinary appends read and parse only the new bytes; truncation, replacement, and in-place rewrites rebuild the index so the result remains identical to a fresh catalog discovery.
Implementations§
Source§impl CodexHistoryTopicIndex
impl CodexHistoryTopicIndex
Sourcepub fn new(sessions_root: &Path) -> CodexHistoryTopicIndex
pub fn new(sessions_root: &Path) -> CodexHistoryTopicIndex
Create an empty index for the Codex sessions root from
HarnessHomes::codex. Call Self::refresh before first use.
Sourcepub fn refresh(&mut self) -> Result<BTreeSet<String>, InterchangeError>
pub fn refresh(&mut self) -> Result<BTreeSet<String>, InterchangeError>
Refresh from durable state and return session ids whose topic changed.
A missing file is a valid empty history. Read errors leave the previous successful index intact so a transient filesystem error cannot erase topics from a live session list.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CodexHistoryTopicIndex
impl RefUnwindSafe for CodexHistoryTopicIndex
impl Send for CodexHistoryTopicIndex
impl Sync for CodexHistoryTopicIndex
impl Unpin for CodexHistoryTopicIndex
impl UnsafeUnpin for CodexHistoryTopicIndex
impl UnwindSafe for CodexHistoryTopicIndex
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
Mutably borrows from an owned value. Read more