Skip to main content

AuditLogStorage

Trait AuditLogStorage 

Source
pub trait AuditLogStorage: Send + Sync {
    // Required methods
    fn query(
        &self,
        parameters: &BACnetAuditLogQueryParameters,
        start_at_sequence_number: Option<u64>,
        requested_count: u16,
    ) -> AuditLogQueryPage;
    fn retained_records(&self) -> &VecDeque<BACnetAuditLogRecordResult>;
}
Expand description

Read-only query capability for an object’s retained Audit Log records.

Implementations return owned pages so the server can release its object database read guard before building and encoding the ComplexACK. This interface never performs persistence I/O or mutates the log.

Required Methods§

Source

fn query( &self, parameters: &BACnetAuditLogQueryParameters, start_at_sequence_number: Option<u64>, requested_count: u16, ) -> AuditLogQueryPage

Filter and page the currently retained in-memory records.

A present start is the corrected-baseline Unsigned64 cursor (Errata 2024-04-29 item 8) and admits only literal sequence identities below it. This intentionally does not add a modular cursor across u64::MAX -> 1.

Source

fn retained_records(&self) -> &VecDeque<BACnetAuditLogRecordResult>

The retained records oldest-to-newest, each with its sequence number.

This is the Log_Buffer list that ReadRange pages (Clause 12.64.10), the same ring query scans, so the two services never see different copies. The view is borrowed: the caller reads it under its object database guard, and nothing is copied or persisted.

The numbers are nonzero and run on by one from the oldest record, 2^64 - 1 wrapping to 1, as the built-in log keeps them. ReadRange relies on that to compute where a sequence number sits: it checks the record it computes and searches the ring only when that record has another number (#1536). A store that breaks this still gets records carrying the number asked for, but not always the ones a search from the oldest would find: a number held twice may be served from its later record, and a zero elsewhere in the ring goes unnoticed when the computed record matches.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§