Crates.io | rsvici |
lib.rs | rsvici |
version | 0.1.1 |
source | src |
created_at | 2022-04-03 14:37:07.67374 |
updated_at | 2022-04-10 08:47:09.791575 |
description | A client library for the VICI protocol |
homepage | |
repository | https://github.com/chitoku-k/rsvici |
max_upload_size | |
id | 561317 |
size | 54,262 |
The rsvici is a client library to configure, control, and monitor the IKE daemon
charon
using the VICI protocol. All the features are implemented on top of the
Tokio runtime to asynchronously interact with charon
.
[dependencies]
rsvici = "0.1"
use std::error::Error;
use serde::Deserialize;
#[derive(Debug, Deserialize)]
struct Version {
daemon: String,
version: String,
sysname: String,
release: String,
machine: String,
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let mut client = rsvici::unix::connect("/run/charon.vici").await?;
let version: Version = client.request("version", ()).await?;
println!("Version: {:#?}", version);
Ok(())
}
The serialization/deserialization implementation has certain behaviors specific to the VICI protocol:
bool
values are serialized to or deserialized from "yes"
or "no"
.Vec<T>
.