pub struct ExternalSource {
key: VerifyingKey,
path: PathBuf,
cache: PathBuf,
pub current: Option<Verified>,
}Fields§
§key: VerifyingKey§path: PathBuf§cache: PathBuf§current: Option<Verified>Implementations§
Source§impl ExternalSource
impl ExternalSource
Sourcepub fn new(
cfg: &ExternalSourceConfig,
cache_dir: &Path,
) -> Result<ExternalSource, String>
pub fn new( cfg: &ExternalSourceConfig, cache_dir: &Path, ) -> Result<ExternalSource, String>
The key must parse; a bad key in the generation is a configuration error.
fn verify(&self, bytes: &[u8], sig_hex: &str) -> Result<(), String>
fn read(&self, path: &Path) -> Result<(Vec<u8>, String), String>
fn check( &self, bytes: Vec<u8>, sig: &str, ) -> Result<Result<Verified, String>, String>
Sourcepub fn load_cache(&mut self) -> Result<(), String>
pub fn load_cache(&mut self) -> Result<(), String>
At start: the cache, re-verified. A cache that no longer verifies was altered on disk: Integrity. No cache is fine.
pub fn poll(&mut self) -> Poll
Sourcepub fn replayed(doc: &Verified, journal: Option<(u64, Hash)>) -> Option<String>
pub fn replayed(doc: &Verified, journal: Option<(u64, Hash)>) -> Option<String>
Whether a verified document is older than, or a different one with the same sequence number as, the last the journal accepted (B-16).
Auto Trait Implementations§
impl Freeze for ExternalSource
impl RefUnwindSafe for ExternalSource
impl Send for ExternalSource
impl Sync for ExternalSource
impl Unpin for ExternalSource
impl UnsafeUnpin for ExternalSource
impl UnwindSafe for ExternalSource
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