Expand description
Application-facing ModelVault API: curated re-exports from modelvault_core and optionally
the DbModel derive.
Add to Cargo.toml:
[dependencies]
modelvault = "0.16"Use prelude for common imports. For full control over dependencies, depend on the
modelvault-core and modelvault-derive crates directly.
Modules§
- prelude
- Re-exports
modelvault_core::preludeplusDbModelwhenderiveis enabled. - schema
- Schema types (same symbols as root re-exports; stable path for docs and examples).
- sql
- Minimal SQL adapter for DB-API (0.10.0+).
Structs§
- Catalog
- Logical catalog: collection names, ids, and current schema version per collection.
- Collection
Id - Stable numeric id for a registered collection (assigned at create time, starting at
1). - Collection
Info - Snapshot of one registered collection (latest schema version).
- Collection
Schema - High-level description of a collection (name, version, fields); used by tooling and derives.
- Database
- Opened ModelVault database: generic over a
Store(FileStoreon disk,VecStorein memory). - Field
Def - One field’s path, type, and optional constraints within a collection schema.
- Field
Path - Dot-style path segments for a field (v1 rows use single-segment top-level names only).
- File
Store - On-disk store: a real file wrapped in a fixed-size page cache.
- Index
Def - Secondary index definition for one collection schema.
- Index
State - Migration
Plan - Open
Options - Options for
crate::db::Database::open_with_optionsand in-memory open helpers. - Open
Options Builder - Builder for
OpenOptions. - Open
Recovery Info - Metadata about recovery actions applied during open.
- OrderBy
- Query
- Query
RowIter - Pull-based row iterator for simple queries (0.7 execution boundary).
- Schema
Version - Monotonic schema version for one collection (starts at
1on create; bumps on each new version). - Validation
Error - Top-level error for
crate::db::Databaseand storage: I/O, on-disk layout, or schema rules. - VecStore
- In-memory growable byte store (same
Storecontract asFileStore).
Enums§
- Constraint
- Declarative constraint on a field (0.6+). Evaluated on insert after type checks.
- DbError
- DbError
Kind - Stable classification of core errors (suitable for matching in higher-level bindings).
- Format
Error - Low-level decode/validation failures for bytes read from the store.
- Index
Kind - Kind of secondary index.
- Migration
Step - Open
Mode - Open mode for on-disk databases.
- Order
Direction - Recovery
Mode - How to open a database when the append log tail may be torn or hold an uncommitted transaction.
- RowValue
- In-memory value for a row field (including nested structures).
- Scalar
Value - Schema
Error - Schema and row-level validation errors (catalog replay, registration, insert/get).
- Transaction
Error - Transaction session errors (0.8+).
- Type
- Logical type of a field in the catalog (mirrors encoding in record payloads where supported).
Traits§
- DbModel
- Marker trait for Rust types that map to ModelVault collection records.
- Store
- Random-access byte image of a ModelVault database (length, read, write, sync).
Functions§
- classify_
schema_ update - Classify a schema update from
(old_fields, old_indexes)to(new_fields, new_indexes). - validate_
model_ fields_ against_ catalog - Validate that a model’s declared fields (and optional indexes) are compatible with an existing collection catalog entry.
Type Aliases§
- Catalog
Record - Alias for encoded catalog records on the wire.
Derive Macros§
- DbModel
- Derive the [
modelvault_core::schema::DbModel] trait for structs.