Skip to main content

Crate sentinel_dbms

Crate sentinel_dbms 

Source

Re-exports§

pub use async_stream;
pub use futures;

Modules§

wal
WAL (Write-Ahead Logging) operations module. WAL (Write-Ahead Logging) functionality for Sentinel DBMS.

Structs§

Collection
A collection represents a namespace for documents in the Sentinel database.
CollectionMetadata
Collection metadata stored on disk.
CollectionWalConfig
Configuration for WAL operations at the collection level.
CollectionWalConfigOverrides
Overrides for CollectionWalConfig, where None means “use existing value”.
CryptoConfig
Global cryptographic configuration. This allows runtime selection of algorithms for all default operations. Defaults to the most secure algorithms available.
Document
Represents a document in the database.
EncryptionKeyManager
Encryption key management utilities
LogEntry
A WAL log entry
Query
Represents a query for filtering documents in a collection.
QueryBuilder
Builder pattern for constructing queries.
QueryResult
The result of executing a query.
Signature
Ed25519 signature.
SigningKey
ed25519 signing key which can be used to produce signatures.
SigningKeyManager
Signing key management utilities
Store
The top-level manager for document collections in Cyberpath Sentinel.
StoreMetadata
Store metadata stored on disk.
StoreWalConfig
Configuration for WAL operations at the store level.
VerificationOptions
Options for controlling verification behavior when reading documents.
VerifyingKey
An ed25519 public key.
WalConfig
Configuration for WAL manager
WalManager
Write-Ahead Log manager
WalRecoveryFailure
Details of a recovery failure
WalRecoveryResult
Result of WAL recovery operation
WalVerificationIssue
Issues found during WAL verification
WalVerificationResult
Result of WAL verification

Enums§

Aggregation
Aggregation operations for queries.
CompressionAlgorithm
Compression algorithms available for WAL file rotation
CryptoError
Comprehensive error type for all sentinel-crypto operations. This enum wraps all possible errors that can occur during cryptographic operations, providing a unified error handling interface. We use thiserror for ergonomic error handling while ensuring all sensitive information is properly abstracted.
EncryptionAlgorithmChoice
Encryption algorithm options for global configuration
EntryType
Types of WAL entries
Filter
A filter condition for querying documents.
HashAlgorithmChoice
Hash algorithm options for global configuration
KeyDerivationAlgorithmChoice
Key derivation algorithm options for global configuration
Operator
Operator for building filters in the query builder.
SentinelError
Sentinel-wide error type for the document DBMS.
SignatureAlgorithmChoice
Signature algorithm options for global configuration
SortOrder
Sort order for query results.
VerificationMode
Verification mode for signature and hash checks.
WalError
Error types for WAL operations
WalFailureMode
Failure handling modes for WAL operations.
WalFormat
WAL file format options

Constants§

COLLECTION_METADATA_FILE
Filename for collection metadata stored within a collection directory.
DATA_DIR
Directory name for storing collection data within a store.
DELETED_DIR
Directory name for soft-deleted documents within a collection.
DOCUMENT_EXTENSION
File extension for document files.
DOCUMENT_SENTINEL_VERSION
The current version of the Sentinel document format.
KEYS_COLLECTION
Name of the special collection used for storing encryption keys.
MAX_COLLECTION_METADATA_SIZE
Maximum size for collection metadata files (1MB).
MAX_STORE_METADATA_SIZE
Maximum size for store metadata files (10MB).
META_SENTINEL_VERSION
The current version of the Sentinel metadata format.
SIGNING_KEY_FILE
Filename for storing signing keys within the keys collection.
STORE_METADATA_FILE
Filename for store metadata stored in the store root directory.
WAL_DIR
Directory name for Write-Ahead Log files within a collection.
WAL_FILE
Filename for the main WAL file within a collection’s WAL directory.

Traits§

WalDocumentOps
Operations required for WAL recovery and verification

Functions§

derive_key_from_passphrase
Derives a 32-byte key from a passphrase using the globally configured algorithm. Returns the randomly generated salt and the derived key.
encrypt_data
Encrypts data using the globally configured algorithm.
get_global_crypto_config
Gets the current global cryptographic configuration. Returns the default configuration if none has been set.
hash_data
Computes the hash of the given JSON data using the globally configured algorithm.
is_global_crypto_config_set
Checks if the global cryptographic configuration has been explicitly set. Returns true if set, false if still using the default lazy-initialized config.
recover_from_wal_force
Recover collection from WAL with conflict resolution
recover_from_wal_safe
Recover collection state from WAL entries
set_global_crypto_config
Sets the global cryptographic configuration. This affects all default cryptographic operations. Can be called multiple times, but a warning is emitted if the config is changed.
sign_hash
Signs the given hash using the globally configured algorithm.
verify_signature
Verifies the signature of the given hash using the globally configured algorithm.
verify_wal_consistency
Verify WAL consistency and final state against disk

Type Aliases§

MetadataVersion
Version of the metadata format.
Result
Result type alias for Sentinel operations.