Skip to main content

kept_images_conformance

Function kept_images_conformance 

pub async fn kept_images_conformance(
    store: &(dyn KeptImages + 'static),
    tamper: Option<&(dyn Fn(&str, &str) + Sync)>,
)
Expand description

What every KeptImages does: keeps what it is given and gives it back, once for the same bytes; refuses an id that is not a hash, a scope that is not 32 hex digits, and bytes that are not the hash they come with; never serves one scope’s image to another; and loads nothing it cannot prove has the hash it was kept under. For an implementation’s own tests: tamper rewrites what was kept under (scope, sha256) the way a local command could, and is None for a keeper that cannot be changed behind its back.

§Panics

When the store breaks a rule.