Rust client for Qdrant vector search engine
bash
cargo add qdrant-client
Run Qdrant with enabled gRPC interface:
```bash
docker run -p 6333:6333 -p 6334:6334 \ -e QDRANTSERVICEGRPC_PORT="6334" \ qdrant/qdrant ``` Or by updating the configuration file:
yaml
service:
grpc_port: 6334
More info about gRPC in documentation.
```rust use tonic::transport::Channel;
let uri = "http://localhost:6334".parse().unwrap(); let endpoint = Channel::builder(uri) .timeout(Duration::fromsecs(5)) .connecttimeout(Duration::fromsecs(5)) .keepalivewhileidle(true);
// connect
is using the Reconnect
network service internally to handle dropped connections
let channel = endpoint.connect().await.unwrap(); // Unwrap in test only
let mut client = QdrantClient::new(channel); let collectionslist = client.collectionapi.list(ListCollectionsRequest {}).await.unwrap(); ```