Module kv_client

Module kv_client 

Source
Expand description

KV client trait - unified interface for key-value operations.

Provides a common abstraction for both remote (gRPC) and embedded (local) access to d-engine’s key-value store.

§Implementations

  • GrpcKvClient (d-engine-client): Remote access via gRPC protocol
  • LocalKvClient (d-engine-server): Zero-overhead embedded access

§Design Principles

  • Unified Interface: Same API for remote and embedded modes
  • Async-first: All operations are async for non-blocking I/O
  • Type Safety: Strong typing with clear error handling
  • Performance: Zero-cost abstractions, no runtime overhead

§Example

async fn store_config<C: KvClient>(client: &C) -> Result<()> {
    client.put(b"config:timeout", b"30s").await?;
    let value = client.get(b"config:timeout").await?;
    Ok(())
}

Traits§

KvClient
Unified key-value store interface.