Skip to main content

Crate yugendb

Crate yugendb 

Source
Expand description

User-facing Rust facade crate for yugendb.

yugendb is the crate Rust applications normally depend on. It re-exports yugendb_core and exposes optional driver modules behind feature flags.

yugendb stores serialised typed values by namespace, collection, and key:

namespace + collection + key -> serialised typed value

SQL drivers use tables, MongoDB uses documents, and Redis uses derived keys behind the driver. Those backend details do not change the public yugendb API.

Project-owned terminology uses en-GB spelling, including initialise, finalise, serialise, deserialise, and behaviour.

§Driver features

  • JSON serialisation is built in through JsonCodec.
  • memory: in-process memory driver.
  • sqlite: SQLite driver.
  • mysql: MySQL driver.
  • mongodb: MongoDB driver.
  • postgres: PostgreSQL driver.
  • redis: Redis driver.
  • all-drivers: enables all bundled driver features.

External-service drivers require their matching database service at runtime.

Modules§

batch
Batch operation types.
capabilities
Driver capability reporting.
codec
Codec model for serialising and deserialising typed values.
collection
Typed collection handle.
driver
Driver trait for concrete storage backends.
drivers
Feature-gated driver exports.
error
Structured error model for yugendb.
key
Namespace, collection name, and key validation.
options
Operation option types.
prelude
Common imports for application code.
store
User-facing store and builder types.
transaction
Transaction trait for drivers that support transaction-like behaviour.
value
Stored byte value and metadata types.

Structs§

Batch
Ordered batch of write operations.
BatchResult
Summary returned after a batch write.
Capabilities
Feature report exposed by each driver.
Collection
Typed handle for records in a collection.
CollectionName
Logical collection name inside a namespace.
DeleteOptions
Options for delete operations.
JsonCodec
JSON codec using serde_json.
Key
Stable key inside a namespace and collection.
Namespace
Logical storage partition above collections.
ReadOptions
Options for read operations.
ScanOptions
Options for prefix scans.
Store
Main user-facing database handle.
StoreBuilder
Builder for Store.
StoredValue
A serialised value and its metadata.
ValueBytes
Opaque serialised value bytes.
ValueMetadata
Metadata stored alongside a serialised value.
WriteOptions
Options for write operations.

Enums§

BatchOperation
A single batch operation.
ErrorCode
Stable cross-language error codes.
YugenDbError
Main structured error type for yugendb.

Traits§

Codec
Object-safe codec contract used by stores.
CodecExt
Typed codec helpers.
Driver
Async storage driver contract.
Transaction
Basic async transaction contract.

Type Aliases§

Result
Result alias used throughout yugendb.