Expand description
Modules§
- ende
- A module for encoding and decoding traits.
- error
- Structured error types for the VSDB public API.
- namespace
- Namespaces: anonymous placement groups (independent engine instances).
Structs§
- Instance
Id - The complete public identity of a collection instance — the same
shape at every layer: in-memory comparison, the persisted meta bytes,
and this token.
ns: None⇔ default namespace ⇔ the 16-byte meta form; a bareu64converts losslessly (From<u64>⇒ns: None). - Namespace
- A cheap, cloneable handle to an engine instance (an anonymous placement group). See the module docs for the design rules.
- Namespace
Opts - Creation-time options; persisted in the registry. Everything is defaulted — this struct exists for the advanced tier.
- NsInfo
- A registry entry as reported by
vsdb_ns_list. - VsDB
- A struct representing the VsDB database.
Constants§
- BIGGEST_
RESERVED_ ID - The biggest reserved ID.
- DEFAULT_
NS_ ID - The default namespace’s id — a fixed constant, never allocated, never present in the registry, never looked up.
- GB
- A constant representing 1 gigabyte in bytes.
- KB
- A constant representing 1 kilobyte in bytes.
- MB
- A constant representing 1 megabyte in bytes.
- PREFIX_
SIZE - The size of a prefix in bytes.
Statics§
- VSDB
- The global instance of the VsDB database.
Traits§
- Batch
Trait - Trait for batch write operations
Functions§
- atomic_
write_ file - Atomically replaces the file at
pathwithbytes. - load_
instance_ meta - Reads the meta file for
idand deserializes it back. - save_
instance_ meta - Serializes
valuewithpostcardand writes it to the owning namespace’s instance-meta directory underid.map_id. - vsdb_
flush - Flushes all data to disk — the default namespace and every open non-default namespace.
- vsdb_
get_ base_ dir - Returns the base directory path for VSDB.
- vsdb_
get_ custom_ dir - Returns the custom directory path for VSDB — the app-level bootstrap anchor, deliberately one per universe (NOT per namespace).
- vsdb_
get_ meta_ dir - Returns the instance-meta directory path of the default
namespace (its root is the base dir, so this equals
Namespace::default_ns().meta_dir(); non-default namespaces keep their metas under their own roots — useNamespace::meta_dir). - vsdb_
get_ system_ dir - Returns the internal system directory path of the default
namespace (≡
Namespace::default_ns().system_dir(); each namespace has its own__SYSTEM__under its root — seeNamespace::system_dir). Also home to the registry-wide state that deliberately stays global: the namespace registry, the prefix allocator ceiling, and the DagMap ID counter. - vsdb_
meta_ path - Returns the default-namespace meta file path for a given map ID
(a bare
u64can only ever address a default-namespace instance; namespace-resident metas live underNamespace::meta_dir). - vsdb_
ns_ close - Closes an open namespace, releasing all of its resources: engine
memory, compaction threads, fds, and mmdb
LOCKfiles. The active memtables are flushed and the WALs synced first (errors surface here, unlike a plain drop). - vsdb_
ns_ destroy - Destroys a namespace: removes its registry entry, then deletes its whole directory tree — O(1) bulk reclaim.
- vsdb_
ns_ list - Lists every registered (non-default) namespace.
- vsdb_
ns_ relocate - Re-points a namespace at a new root directory (e.g. after moving a volume). Updates the registry only — moving the data is the operator’s job, done before calling this. A target that does not already hold an initialized dataset (format marker + per-shard engine anchors) is refused: repointing at it would durably orphan the real data behind a silent success. Whether it is the right dataset cannot be verified — roots carry no namespace id.
- vsdb_
set_ base_ dir - Sets the base directory path for VSDB manually.
Type Aliases§
- NsId
- A namespace identifier: small, stable, allocated once at creation, never reused.
- Pre
- A type alias for a prefix, represented as a
u64. - PreBytes
- A type alias for a prefix represented as a byte array.
- RawBytes
- A type alias for a vector of bytes, commonly used for raw data.
- RawKey
- A type alias for a raw key, represented as a vector of bytes.
- RawValue
- A type alias for a raw value, represented as a vector of bytes.