Skip to main content

Crate statelet_sdk

Crate statelet_sdk 

Source
Expand description

Statelet Rust SDK — async gRPC client.

§Example

use statelet_sdk::StateletClient;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut client = StateletClient::connect("http://127.0.0.1:7379").await?;

    // Ping
    println!("{}", client.ping().await?);

    // KV operations
    client.put(b"hello", b"world", None).await?;
    if let Some(value) = client.get(b"hello", None).await? {
        println!("got: {:?}", value);
    }
    client.delete(b"hello", None).await?;
    Ok(())
}

Re-exports§

pub use cdc::CheckpointStore;
pub use cdc::CommittedChange;
pub use cdc::ConsumeError;
pub use cdc::FeedItem;
pub use cdc::FeedStream;
pub use cdc::FeedTransport;
pub use cdc::FileCheckpointStore;
pub use cdc::SubscribeCommittedOptions;

Modules§

cdc
Durable change-feed (CDC) — issue #824 (CDC epic #692, Phase 5c).
proto

Structs§

GraphQueryOptions
Out-of-band knobs for StateletClient::graph_query. The default means “let the gateway decide”: the default graph, no extra row cap, and no temporal filter on either axis.
GraphQueryResult
The projected result set of a StateletClient::graph_query.
GroupSpec
Result grouping / field-collapse options for StateletClient::vector_search_grouped (epic #1427). Collapse results to at most group_size hits per distinct value of the payload field field, returning up to groups distinct group keys, ordered by ascending distance.
GrpcFeedStream
A live gRPC committed-feed stream, wrapping tonic::Streaming.
StateletClient
Async gRPC client for Statelet.
VectorIndexConfig
HNSW vector index configuration.
VectorSearchResult
A single nearest-neighbor search result.

Enums§

GraphValue
One projected column value. Json carries the hydrated ROLE_NodeProp blob for a whole node, verbatim.
WriteOp
Batch write operation.