Development Documentation (main branch) - For stable release docs, see docs.rs/eidetica
Skip to main content

DocStoreInit

Trait DocStoreInit 

Source
pub trait DocStoreInit<'u> {
    // Required methods
    fn initialize_doc(
        self,
        name: impl Into<String>,
        doc: Doc,
    ) -> DatabaseBuilder<'u>;
    fn empty_doc(self, name: impl Into<String>) -> DatabaseBuilder<'u>;
}
Expand description

Builder extension for DocStore: ergonomic, non-generic ways to register a DocStore inside a [DatabaseBuilder] chain.

Each Store module ships its own extension trait so the builder’s core API stays minimal — only the generic DatabaseBuilder::initialize_store primitive. User-defined Stores follow the same pattern.

Required Methods§

Source

fn initialize_doc( self, name: impl Into<String>, doc: Doc, ) -> DatabaseBuilder<'u>

Register a DocStore prepopulated with the contents of doc.

Each top-level key in doc is written into the DocStore via DocStore::set. The caller picks the storage layout — flat fields, a single set_json("data", ...) blob, nested values, whatever the downstream use case wants — by how they build the Doc before passing it in.

Source

fn empty_doc(self, name: impl Into<String>) -> DatabaseBuilder<'u>

Register an empty DocStore.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§