pub struct RevocationView { /* private fields */ }Expand description
Arc-swap-backed read-only snapshot store. Cheap to clone (it is itself
an Arc internally) so embedding kernels can hand a clone to every
dispatch worker.
Implementations§
Source§impl RevocationView
impl RevocationView
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new view holding the RevocationSnapshot::empty
sentinel.
Sourcepub fn load(&self) -> Arc<RevocationSnapshot>
pub fn load(&self) -> Arc<RevocationSnapshot>
Borrow the currently-installed snapshot for the lifetime of the returned guard. Readers never block writers and vice versa.
Sourcepub fn install_if_newer(
&self,
candidate: RevocationSnapshot,
) -> Result<Arc<RevocationSnapshot>, RevocationViewError>
pub fn install_if_newer( &self, candidate: RevocationSnapshot, ) -> Result<Arc<RevocationSnapshot>, RevocationViewError>
Replace the snapshot iff candidate.epoch > current.epoch.
Returns the previously-installed snapshot on success. Returns
RevocationViewError::NonMonotoneEpoch when the candidate’s
epoch does not strictly advance the current one; the active
snapshot is left unchanged in that case (fail-closed).
Sourcepub fn is_revoked(&self, subject: &RevocationViewSubject) -> bool
pub fn is_revoked(&self, subject: &RevocationViewSubject) -> bool
Convenience for the most common dispatch lookup.
Sourcepub fn current_epoch(&self) -> u64
pub fn current_epoch(&self) -> u64
Currently-installed epoch counter. Cheap (no clone of the snapshot body).