pub struct SignerChain { /* private fields */ }Expand description
The chain of signer lists an enforcer trusts, from the pinned version 1 to the highest version it has accepted.
Implementations§
Source§impl SignerChain
impl SignerChain
Sourcepub fn genesis(fingerprint: &str, statement: &SignedStatement) -> Result<Self>
pub fn genesis(fingerprint: &str, statement: &SignedStatement) -> Result<Self>
Trust version 1, which must hash to fingerprint (SHA256:<hex>).
The project is the one version 1 names.
Sourcepub fn from_statements(
fingerprint: &str,
statements: &[SignedStatement],
) -> Result<Self>
pub fn from_statements( fingerprint: &str, statements: &[SignedStatement], ) -> Result<Self>
Build a chain from version 1 on, verifying every link.
Sourcepub fn digest_of(&self, version: u64) -> Option<&str>
pub fn digest_of(&self, version: u64) -> Option<&str>
The digest of version version, if the chain holds it.
Sourcepub fn current(&self) -> &TrustedList
pub fn current(&self) -> &TrustedList
The highest trusted version.
Sourcepub fn version(&self, version: u64) -> Option<&TrustedList>
pub fn version(&self, version: u64) -> Option<&TrustedList>
Trusted version version, if the chain holds it.
Sourcepub fn statements(&self) -> &[SignedStatement]
pub fn statements(&self) -> &[SignedStatement]
Every trusted version’s statement, oldest first, for storage.
Sourcepub fn extend(&mut self, statements: &[SignedStatement]) -> Result<bool>
pub fn extend(&mut self, statements: &[SignedStatement]) -> Result<bool>
Accept whatever statements adds beyond the current version.
Versions already trusted are skipped when their bytes match and refused when they don’t, so a second, different version N is reported as a fork rather than ignored. The rest must follow on in order. Returns whether the chain grew.
Trait Implementations§
Source§impl Clone for SignerChain
impl Clone for SignerChain
Auto Trait Implementations§
impl Forget for SignerChain
impl Freeze for SignerChain
impl Move for SignerChain
impl RefUnwindSafe for SignerChain
impl Send for SignerChain
impl Sync for SignerChain
impl Unpin for SignerChain
impl UnsafeUnpin for SignerChain
impl UnwindSafe for SignerChain
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