Trait holochain_types::dna::DnaStore
source · [−]pub trait DnaStore: Default + Send + Sync {
fn add_dna(&mut self, dna: DnaFile);
fn add_dnas<T: IntoIterator<Item = (DnaHash, DnaFile)> + 'static>(
&mut self,
dnas: T
);
fn add_entry_def(&mut self, k: EntryDefBufferKey, entry_def: EntryDef);
fn add_entry_defs<T: IntoIterator<Item = (EntryDefBufferKey, EntryDef)> + 'static>(
&mut self,
entry_defs: T
);
fn list(&self) -> Vec<DnaHash>ⓘ;
fn get(&self, hash: &DnaHash) -> Option<DnaFile>;
fn get_entry_def(&self, k: &EntryDefBufferKey) -> Option<EntryDef>;
}
Expand description
A readable and writable store of DnaFiles and EntryDefs
Required methods
Add multiple DnaFiles to the store
fn add_entry_def(&mut self, k: EntryDefBufferKey, entry_def: EntryDef)
fn add_entry_def(&mut self, k: EntryDefBufferKey, entry_def: EntryDef)
Add an EntryDef to the store
fn add_entry_defs<T: IntoIterator<Item = (EntryDefBufferKey, EntryDef)> + 'static>(
&mut self,
entry_defs: T
)
fn add_entry_defs<T: IntoIterator<Item = (EntryDefBufferKey, EntryDef)> + 'static>(
&mut self,
entry_defs: T
)
Add multiple EntryDefs to the store
List all DNAs in the store
fn get_entry_def(&self, k: &EntryDefBufferKey) -> Option<EntryDef>
fn get_entry_def(&self, k: &EntryDefBufferKey) -> Option<EntryDef>
Get a particular EntryDef
Implementors
A readable and writable store of DnaFiles and EntryDefs