pub trait DatumStore {
// Required methods
fn intern(&mut self, datum: Datum) -> Result<ContentId>;
fn get(&self, id: &ContentId) -> Result<Option<&Datum>>;
fn contains(&self, id: &ContentId) -> bool;
}Expand description
Contract for interning and resolving content-addressed Datums.
This is protocol the libraries implement; the kernel ships a simple
BTreeDatumStore but defines no persistent storage policy.
Required Methods§
Sourcefn intern(&mut self, datum: Datum) -> Result<ContentId>
fn intern(&mut self, datum: Datum) -> Result<ContentId>
Interns datum, returning its ContentId; re-interning equal data is
idempotent.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".