pub struct Store(_);
Implementations§
source§impl Store
impl Store
sourcepub fn new<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn new<P: AsRef<Path>>(path: P) -> Result<Self>
Opens a Store
against the specified path.
See new_with_cfg(..)
for more details
Arguments
path
- path to the db directory of JSON documents
sourcepub fn new_with_cfg<P: AsRef<Path>>(path: P, cfg: Config) -> Result<Self>
pub fn new_with_cfg<P: AsRef<Path>>(path: P, cfg: Config) -> Result<Self>
Opens a Store
against the specified path with the given configuration
If the Store
already exists, it will be opened, otherwise this has the side-effect of creating the new Store
and the backing directories and files.
Arguments
path
- path to the db directory of JSON documents, if configured for single db mode then.json
will be used as the extension (replacing any existing extension)cfg
- configuration for the DB instance
sourcepub fn path(&self) -> &Path
pub fn path(&self) -> &Path
Returns the storage path for the backing JSON store.
In single-file-mode this will be the JSON file location, otherwise it’s the directory in which all JSON objects are stored.