pub struct OfflineBuffer<S: BufferStore> { /* private fields */ }Expand description
A store-and-forward buffer that accumulates signed AuditRecords during connectivity loss
and replays them in order when the link recovers.
Implementations§
Source§impl<S: BufferStore> OfflineBuffer<S>
impl<S: BufferStore> OfflineBuffer<S>
Sourcepub fn push(
&mut self,
record: AuditRecord,
raw_payload: Vec<u8>,
) -> Result<(), S::Error>
pub fn push( &mut self, record: AuditRecord, raw_payload: Vec<u8>, ) -> Result<(), S::Error>
Push a signed record into the buffer.
Sourcepub fn flush<R, L, O>(
&mut self,
service: &mut IngestService<R, L, O>,
) -> Result<FlushReport, FlushError<S::Error>>
pub fn flush<R, L, O>( &mut self, service: &mut IngestService<R, L, O>, ) -> Result<FlushReport, FlushError<S::Error>>
Replay buffered records through service and return a FlushReport.
Records are submitted oldest-first. A record that is accepted or already a duplicate is removed from the buffer. The first non-duplicate error stops the replay; any remaining records are preserved for the next flush attempt.
Auto Trait Implementations§
impl<S> Freeze for OfflineBuffer<S>where
S: Freeze,
impl<S> RefUnwindSafe for OfflineBuffer<S>where
S: RefUnwindSafe,
impl<S> Send for OfflineBuffer<S>where
S: Send,
impl<S> Sync for OfflineBuffer<S>where
S: Sync,
impl<S> Unpin for OfflineBuffer<S>where
S: Unpin,
impl<S> UnsafeUnpin for OfflineBuffer<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for OfflineBuffer<S>where
S: UnwindSafe,
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