# client
`src/features/client/api.rs`
The client driver layer. Provides an embedded `RustDriver` for in-process use and a gRPC contract definition for remote access.
---
## Embedded Driver
```rust
pub fn embedded_driver(config: DriverConfig) -> Result<RustDriver>
```
Opens an embedded store and returns a `RustDriver` bound to it. The driver owns the `StorageHandle` internally.
---
## DriverConfig
```rust
pub struct DriverConfig {
pub data_dir: PathBuf,
pub execute_params: ExecuteParams,
pub idempotency_cache_capacity: usize, // default: 4096
pub persist_idempotency_keys: bool, // default: true
}
impl DriverConfig {
pub fn embedded_data_dir(data_dir: PathBuf) -> Self
}
```
---
## RustDriver
```rust
pub struct RustDriver { /* ... */ }
```
The driver exposes query and ingest operations. The exact method signatures are defined in `src/features/client/api/driver.rs` and surface the query + ingest APIs with idempotency key support.
---
## RowCursor
```rust
pub struct RowCursor { /* ... */ }
impl RowCursor {
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
}
impl Iterator for RowCursor {
type Item = runtime::Row;
}
```
A streaming cursor over query results. Implements `Iterator<Item = Row>` so it can be used in `for` loops or collected.
---
## MutationOptions
```rust
pub struct MutationOptions {
pub idempotency_key: Option<String>,
}
```
An optional idempotency key for write operations. When set and `persist_idempotency_keys` is enabled, duplicate writes with the same key are silently deduplicated.
---
## gRPC Contract
The gRPC service contract is exposed as a constant for use by code generators:
```rust
pub struct GrpcContract {
pub service_name: &'static str,
pub package: &'static str,
pub version: &'static str,
pub proto_path: &'static str,
}
pub const GRPC_CONTRACT: GrpcContract = GrpcContract {
service_name: "IridiumService",
package: "iridium.v1",
version: "v1",
proto_path: "proto/iridium/v1/iridium.proto",
};
```
The `.proto` definition lives at `proto/iridium/v1/iridium.proto`.
---
## Errors
```rust
pub enum DriverError {
Query(QueryError),
Runtime(ExplainError),
Storage(StorageError),
InvalidConfig(String),
Internal(String),
}
pub enum RetryClass {
Retryable, // transient I/O / SSTable errors
NonRetryable, // malformed input, corrupt data, config errors
}
impl DriverError {
pub fn retry_class(&self) -> RetryClass
}
pub type Result<T> = std::result::Result<T, DriverError>;
```