pub struct RetryBuffer { /* private fields */ }Expand description
File-based retry buffer for failed enrichment attempts.
Implementations§
Source§impl RetryBuffer
impl RetryBuffer
Sourcepub fn buffer_path() -> PathBuf
pub fn buffer_path() -> PathBuf
Get the default buffer directory path.
Uses XDG state directory: ~/.local/state/nexus-memory-system/pending-enrichment/
Sourcepub fn write_failed(
&self,
event: &NormalizedHookEvent,
candidates: &[MemoryCandidate],
error: &str,
) -> Result<PathBuf>
pub fn write_failed( &self, event: &NormalizedHookEvent, candidates: &[MemoryCandidate], error: &str, ) -> Result<PathBuf>
Write a failed enrichment attempt to the buffer.
Creates a JSON file named {timestamp}_{uuid}.json in the buffer directory.
Creates the directory if it doesn’t exist.
Returns the path to the created file.
Sourcepub fn list_pending(&self) -> Result<Vec<PathBuf>>
pub fn list_pending(&self) -> Result<Vec<PathBuf>>
List all pending retry artifacts in the buffer directory.
Returns paths to all .json files in the buffer.
Sourcepub fn read_pending(path: &Path) -> Result<RetryArtifact>
pub fn read_pending(path: &Path) -> Result<RetryArtifact>
Read a pending retry artifact from disk.
Sourcepub fn remove_pending(path: &Path) -> Result<()>
pub fn remove_pending(path: &Path) -> Result<()>
Remove a pending retry artifact from disk.
Sourcepub fn pending_count(&self) -> Result<usize>
pub fn pending_count(&self) -> Result<usize>
Count the number of pending retry artifacts.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RetryBuffer
impl RefUnwindSafe for RetryBuffer
impl Send for RetryBuffer
impl Sync for RetryBuffer
impl Unpin for RetryBuffer
impl UnsafeUnpin for RetryBuffer
impl UnwindSafe for RetryBuffer
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more