pub struct ApprovalStore { /* private fields */ }Expand description
Persisted operator hash approvals of one node.
Implementations§
Source§impl ApprovalStore
impl ApprovalStore
Sourcepub fn open(
dir: &Path,
anchors: Arc<TrustAnchors>,
local: LocalMeshId,
) -> Result<Self, LicenceError>
pub fn open( dir: &Path, anchors: Arc<TrustAnchors>, local: LocalMeshId, ) -> Result<Self, LicenceError>
Open the store in dir. A missing file is an empty store; a bad file
is an error and nothing is written.
Sourcepub fn open_or_poisoned(
dir: &Path,
anchors: Arc<TrustAnchors>,
local: LocalMeshId,
) -> Self
pub fn open_or_poisoned( dir: &Path, anchors: Arc<TrustAnchors>, local: LocalMeshId, ) -> Self
Self::open, but a bad file gives a poisoned store: it has no
active approvals, refuses writes and leaves the file alone.
Sourcepub fn accept(&self, signed: &SignedApproval) -> Result<Outcome, LicenceError>
pub fn accept(&self, signed: &SignedApproval) -> Result<Outcome, LicenceError>
Accept an approval: pinned operator signature, approval.mesh_id
equal to the local mesh id. A repeat is Outcome::Duplicate.
Sourcepub fn covering(
&self,
cog_id: &str,
version: &str,
sha256: &str,
) -> Option<String>
pub fn covering( &self, cog_id: &str, version: &str, sha256: &str, ) -> Option<String>
The content key of an active approval for cog_id version that
lists sha256.
Source§impl ApprovalStore
impl ApprovalStore
Sourcepub fn rows(&self) -> Vec<ApprovalRow>
pub fn rows(&self) -> Vec<ApprovalRow>
Every held approval, active or orphaned.
Sourcepub fn orphaned_signed(&self) -> Vec<SignedApproval> ⓘ
pub fn orphaned_signed(&self) -> Vec<SignedApproval> ⓘ
The signed envelopes of the orphaned approvals: the CLI verifies each against the operator’s own key before it re-signs it.
Sourcepub fn orphaned_approvals(&self) -> Vec<Approval>
pub fn orphaned_approvals(&self) -> Vec<Approval>
The orphaned approvals themselves (--reapprove-orphaned re-signs
them for the new mesh id).
Source§impl ApprovalStore
impl ApprovalStore
Sourcepub fn holds(&self, content_key: &str) -> bool
pub fn holds(&self, content_key: &str) -> bool
True when an approval with this content key is held.
Sourcepub fn sync_approvals_page(
&self,
after: Option<&str>,
max_entries: usize,
max_bytes: usize,
) -> (Vec<(String, SignedApproval)>, bool)
pub fn sync_approvals_page( &self, after: Option<&str>, max_entries: usize, max_bytes: usize, ) -> (Vec<(String, SignedApproval)>, bool)
A page of active approvals (for the local mesh) as (content key, approval) ordered by content key and strictly after after, within
max_entries and max_bytes; and whether more follow. Empty while
poisoned.
Auto Trait Implementations§
impl !Freeze for ApprovalStore
impl RefUnwindSafe for ApprovalStore
impl Send for ApprovalStore
impl Sync for ApprovalStore
impl Unpin for ApprovalStore
impl UnsafeUnpin for ApprovalStore
impl UnwindSafe for ApprovalStore
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more