15 lines
443 B
Rust
15 lines
443 B
Rust
use chainfire_client::Client;
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
// Build a client with default retry/backoff.
|
|
let mut client = Client::builder("http://127.0.0.1:2379").build().await?;
|
|
|
|
// Simple put/get roundtrip.
|
|
client.put_str("/example/key", "value").await?;
|
|
if let Some(val) = client.get_str("/example/key").await? {
|
|
println!("Got value: {}", val);
|
|
}
|
|
|
|
Ok(())
|
|
}
|