Skip to main content

Crate modelvault

Crate modelvault 

Source
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::prelude plus DbModel when derive is 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.
CollectionId
Stable numeric id for a registered collection (assigned at create time, starting at 1).
CollectionInfo
Snapshot of one registered collection (latest schema version).
CollectionSchema
High-level description of a collection (name, version, fields); used by tooling and derives.
Database
Opened ModelVault database: generic over a Store (FileStore on disk, VecStore in memory).
FieldDef
One field’s path, type, and optional constraints within a collection schema.
FieldPath
Dot-style path segments for a field (v1 rows use single-segment top-level names only).
FileStore
On-disk store: a real file wrapped in a fixed-size page cache.
IndexDef
Secondary index definition for one collection schema.
IndexState
MigrationPlan
OpenOptions
Options for crate::db::Database::open_with_options and in-memory open helpers.
OpenOptionsBuilder
Builder for OpenOptions.
OpenRecoveryInfo
Metadata about recovery actions applied during open.
OrderBy
Query
QueryRowIter
Pull-based row iterator for simple queries (0.7 execution boundary).
SchemaVersion
Monotonic schema version for one collection (starts at 1 on create; bumps on each new version).
ValidationError
Top-level error for crate::db::Database and storage: I/O, on-disk layout, or schema rules.
VecStore
In-memory growable byte store (same Store contract as FileStore).

Enums§

Constraint
Declarative constraint on a field (0.6+). Evaluated on insert after type checks.
DbError
DbErrorKind
Stable classification of core errors (suitable for matching in higher-level bindings).
FormatError
Low-level decode/validation failures for bytes read from the store.
IndexKind
Kind of secondary index.
MigrationStep
OpenMode
Open mode for on-disk databases.
OrderDirection
RecoveryMode
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).
ScalarValue
SchemaError
Schema and row-level validation errors (catalog replay, registration, insert/get).
TransactionError
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§

CatalogRecord
Alias for encoded catalog records on the wire.

Derive Macros§

DbModel
Derive the [modelvault_core::schema::DbModel] trait for structs.