Skip to main content

DirectoryVersions

Trait DirectoryVersions 

Source
pub trait DirectoryVersions: Send + Sync {
    // Required methods
    fn highest(&self) -> Result<u64, PeeringError>;
    fn record(&self, version: u64) -> Result<(), PeeringError>;
}
Expand description

The persisted anti-rollback floor: the highest device-directory version this device has verified. Implementations must be monotonic — record never lowers it — and durable across restarts, or a reboot readmits a stale directory.

Required Methods§

Source

fn highest(&self) -> Result<u64, PeeringError>

The highest version recorded so far (0 when none).

Source

fn record(&self, version: u64) -> Result<(), PeeringError>

Record that version verified; the floor becomes max(floor, version).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§