pub struct HyphaeEngine { /* private fields */ }Expand description
Embeddable autonomous Hyphae engine.
Implementations§
Source§impl HyphaeEngine
impl HyphaeEngine
Sourcepub fn open(path: impl AsRef<Path>) -> Result<OpenedEngine, EngineError>
pub fn open(path: impl AsRef<Path>) -> Result<OpenedEngine, EngineError>
Opens one exclusively owned data directory and completes recovery.
§Errors
Returns an error for directory contention, corruption, unsupported formats, snapshot mismatch, or failed index replay.
Sourcepub fn put_record(
&mut self,
transaction_id: Uuid,
record: &Record,
) -> Result<AppendOutcome, EngineError>
pub fn put_record( &mut self, transaction_id: Uuid, record: &Record, ) -> Result<AppendOutcome, EngineError>
Atomically stores one canonical structured record.
§Errors
Returns a document codec or durable storage error.
Sourcepub fn put_records(
&mut self,
transaction_id: Uuid,
records: &[Record],
) -> Result<AppendOutcome, EngineError>
pub fn put_records( &mut self, transaction_id: Uuid, records: &[Record], ) -> Result<AppendOutcome, EngineError>
Atomically stores a batch of canonical structured records.
Encoding every document and checking duplicate keys happens before the log append, so a codec failure cannot partially commit the batch.
§Errors
Returns an error for duplicate batch keys, document bounds, key bounds, idempotency conflicts, or durable storage failures.
Sourcepub fn delete_record(
&mut self,
transaction_id: Uuid,
key: &[u8],
) -> Result<AppendOutcome, EngineError>
pub fn delete_record( &mut self, transaction_id: Uuid, key: &[u8], ) -> Result<AppendOutcome, EngineError>
Atomically deletes one structured record.
§Errors
Returns a key-validation, idempotency, or durable storage error.
Sourcepub fn delete_records(
&mut self,
transaction_id: Uuid,
keys: &[&[u8]],
) -> Result<AppendOutcome, EngineError>
pub fn delete_records( &mut self, transaction_id: Uuid, keys: &[&[u8]], ) -> Result<AppendOutcome, EngineError>
Atomically deletes a batch of structured records.
Duplicate keys are rejected before the log append. Deleting a missing key remains a successful durable operation.
§Errors
Returns an error for duplicate keys, invalid key bounds, idempotency conflicts, or durable storage failures.
Sourcepub fn get_record(&self, key: &[u8]) -> Result<Option<Record>, EngineError>
pub fn get_record(&self, key: &[u8]) -> Result<Option<Record>, EngineError>
Gets and verifies one structured record by binary key.
§Errors
Returns a key, storage, or canonical document verification error.
Sourcepub fn get_record_with_proof(
&self,
key: &[u8],
) -> Result<ResultProofArtifact, EngineError>
pub fn get_record_with_proof( &self, key: &[u8], ) -> Result<ResultProofArtifact, EngineError>
Gets one structured record and binds the complete result, including absence, to a canonical snapshot witness.
§Errors
Returns a key, storage, document, snapshot, or result-proof error.
Sourcepub fn query(
&self,
query: &Query,
limits: &ExecutionLimits,
) -> Result<QueryResult, EngineError>
pub fn query( &self, query: &Query, limits: &ExecutionLimits, ) -> Result<QueryResult, EngineError>
Executes deterministic structured query over all durable documents.
Storage scan and document decoding consume the same wall-clock timeout; the reference executor receives only the remaining duration.
§Errors
Returns a storage, document, query validation, global budget, aggregate, or timeout error. No partial page is returned.
Sourcepub fn query_with_proof(
&self,
query: &Query,
limits: &ExecutionLimits,
) -> Result<ResultProofArtifact, EngineError>
pub fn query_with_proof( &self, query: &Query, limits: &ExecutionLimits, ) -> Result<ResultProofArtifact, EngineError>
Executes one structured query and binds its complete logical result to a canonical snapshot witness at the same locked checkpoint.
§Errors
Returns any ordinary query error plus snapshot or proof creation failures. No proof is returned for a partial or failed query.
Sourcepub fn retrieve_vectors(
shards: &[&[VectorRecord]],
request: &RetrievalRequest,
limits: &RetrievalLimits,
) -> Result<RetrievalOutcome, EngineError>
pub fn retrieve_vectors( shards: &[&[VectorRecord]], request: &RetrievalRequest, limits: &RetrievalLimits, ) -> Result<RetrievalOutcome, EngineError>
Executes exact provider-neutral vector retrieval without persisting or producing embeddings.
§Errors
Returns vector, shape, duplicate-key, budget, or timeout errors.
Sourcepub fn snapshot(&self) -> Result<SnapshotInfo, EngineError>
pub fn snapshot(&self) -> Result<SnapshotInfo, EngineError>
Creates or reuses a verified logical snapshot.
§Errors
Returns a stale-handle, index, or snapshot error.
Sourcepub fn compact(&mut self) -> Result<CompactionOutcome, EngineError>
pub fn compact(&mut self) -> Result<CompactionOutcome, EngineError>
Commits an anchored compaction generation.
§Errors
Returns a stale-handle, snapshot, segment, or manifest error.
Sourcepub fn backup(
&self,
destination: impl AsRef<Path>,
) -> Result<BackupInfo, EngineError>
pub fn backup( &self, destination: impl AsRef<Path>, ) -> Result<BackupInfo, EngineError>
Creates an atomic portable backup at the locked logical checkpoint.
§Errors
Returns a snapshot, destination, synchronization, or promotion error.
Sourcepub fn verify_backup(path: impl AsRef<Path>) -> Result<BackupInfo, EngineError>
pub fn verify_backup(path: impl AsRef<Path>) -> Result<BackupInfo, EngineError>
Verifies a portable backup without opening a live data directory.
§Errors
Returns an error for a malformed layout, metadata mismatch, or corrupt snapshot.
Sourcepub fn restore_backup(
backup: impl AsRef<Path>,
destination: impl AsRef<Path>,
) -> Result<RestoreInfo, EngineError>
pub fn restore_backup( backup: impl AsRef<Path>, destination: impl AsRef<Path>, ) -> Result<RestoreInfo, EngineError>
Restores a backup to a new atomically activated data directory.
§Errors
Returns an error before destination activation if verification, index reconstruction, reopen, or filesystem synchronization fails.