pub struct ReportTracker { /* private fields */ }Expand description
Per-connection tracker for paginated reports.
Created when the authenticated message loop starts, dropped when the connection closes. No shared or global state.
Implementations§
Source§impl ReportTracker
impl ReportTracker
Sourcepub fn register_page(
&mut self,
report_id: Uuid,
page: u32,
total_pages: u32,
) -> Result<PageOutcome, WireValidationError>
pub fn register_page( &mut self, report_id: Uuid, page: u32, total_pages: u32, ) -> Result<PageOutcome, WireValidationError>
Register a page of a paginated report.
Returns:
Ok(PageOutcome::Pending)if more pages are expected.Ok(PageOutcome::Final { .. })if all pages have now been received.Err(WireValidationError)if limits are violated (duplicate page, too many concurrent reports,total_pagesmismatch, etc.).
The caller must process the page’s payload regardless of the outcome.
Sourcepub fn add_discovered_count(&mut self, report_id: Uuid, count: u32)
pub fn add_discovered_count(&mut self, report_id: Uuid, count: u32)
Add to the accumulated discovered_count for an in-progress report.
No-op if the report has already been finalized or does not exist.
Sourcepub fn evict_expired(&mut self)
pub fn evict_expired(&mut self)
Evict reports that have exceeded the total or idle timeout.
Called automatically by register_page. Can also
be called periodically from a background task.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Returns the number of currently pending reports.
Trait Implementations§
Source§impl Debug for ReportTracker
impl Debug for ReportTracker
Auto Trait Implementations§
impl Freeze for ReportTracker
impl RefUnwindSafe for ReportTracker
impl Send for ReportTracker
impl Sync for ReportTracker
impl Unpin for ReportTracker
impl UnsafeUnpin for ReportTracker
impl UnwindSafe for ReportTracker
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