Rust SDK
Install and use the RankVectors Rust SDK
Installation
Add to Cargo.toml:
[dependencies]
rankvectors = "1.0"
Quick Start
use rankvectors::{Configuration, ApiClient, ProjectsApi, CreateProjectRequest};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut config = Configuration::default();
config.api_key = Some("YOUR_API_KEY".to_string());
let client = ApiClient::new(config);
let api = ProjectsApi::new(client);
let request = CreateProjectRequest {
name: "My Website".to_string(),
domain: "https://example.com".to_string(),
preferred_sdk: Some("rust".to_string()),
..Default::default()
};
let project = api.create_project(request).await?;
println!("Project created: {}", project.id);
Ok(())
}
More Examples
See the API Reference for complete API documentation.