pub struct Ledger {
pub prefix: String,
pub created: bool,
pub fingerprint: Option<String>,
pub install: Option<String>,
pub signer_list: Option<Entry>,
}Expand description
The ledger of one install.
Fields§
§prefix: StringThe install’s prefix; it must equal where the ledger was found.
created: boolSetup writes true, so an existing ledger is never read as no ledger.
fingerprint: Option<String>The fingerprint the install first accepted state under.
install: Option<String>The install id the install first accepted state under.
signer_list: Option<Entry>Highest signer list version accepted.
Implementations§
Source§impl Ledger
impl Ledger
Sourcepub fn merge(&mut self, other: &Ledger) -> Result<()>
pub fn merge(&mut self, other: &Ledger) -> Result<()>
Take the higher value of each entry from other. Two different
statements with one sequence, or two trust roots, are a fork and an
error.
Sourcepub fn check_root(
&self,
fingerprint: Option<&str>,
install: &InstallId,
) -> Result<()>
pub fn check_root( &self, fingerprint: Option<&str>, install: &InstallId, ) -> Result<()>
Refuse a trust root other than the one the install accepted state under, or none where it had one. Protection is sticky: removing or changing the settings, or moving the install, never makes an enforcer run something new.
Sourcepub fn check_size(&self) -> Result<()>
pub fn check_size(&self) -> Result<()>
Refuse a ledger that doesn’t fit its store.
Sourcepub fn adopt_root(&mut self, fingerprint: &str, install: &InstallId)
pub fn adopt_root(&mut self, fingerprint: &str, install: &InstallId)
Record the trust root, after Ledger::check_root passed.
Sourcepub fn check_chain(&self, chain: &SignerChain) -> Result<()>
pub fn check_chain(&self, chain: &SignerChain) -> Result<()>
Refuse a chain that stops below the accepted version or forks from it.
Sourcepub fn record_chain(&mut self, chain: &SignerChain)
pub fn record_chain(&mut self, chain: &SignerChain)
Record the chain’s current version.