Trait infinitree::index::Index

source ·
pub trait Index: Send + Sync {
    // Required methods
    fn store_all(&mut self) -> Result<Vec<Intent<Box<dyn Store>>>>;
    fn load_all(&mut self) -> Result<Vec<Intent<Box<dyn Load>>>>;
}
Expand description

Any structure that is usable as an Index

The two mandatory functions, store_all and load_all are automatically generated if the crate::Index macro is used to derive this trait.

Generally an index will allow you to work with its fields independently and in-memory, and the functions of this trait will only help accessing backing storage. The Intent instances wrap each field in a way that an Infinitree can work with.

Required Methods§

source

fn store_all(&mut self) -> Result<Vec<Intent<Box<dyn Store>>>>

Generate an Intent wrapper for each field in the Index.

You should normally use the Index derive macro to generate this.

source

fn load_all(&mut self) -> Result<Vec<Intent<Box<dyn Load>>>>

Generate an Intent wrapper for each field in the Index.

You should normally use the Index derive macro to generate this.

Implementors§

source§

impl<K, V> Index for Map<K, V>where K: Key + Clone, V: Value + Clone,

source§

impl<K, V> Index for VersionedMap<K, V>where K: Key + Clone, V: Value,

source§

impl<T> Index for LinkedList<T>where T: 'static + Value + Clone,

source§

impl<T> Index for List<T>where T: 'static + Value + Clone,