| Crates.io | zinit-client |
| lib.rs | zinit-client |
| version | 0.4.0 |
| created_at | 2025-06-15 15:49:23.393845+00 |
| updated_at | 2025-07-08 10:34:57.974431+00 |
| description | A Rust client library for interacting with Zinit service manager |
| homepage | |
| repository | https://github.com/threefoldtech/zinit-client |
| max_upload_size | |
| id | 1713428 |
| size | 213,347 |
A Rust client library for the Zinit service manager.
Universal Compatibility: Automatically works with both old (v0.2.14) and new (v0.2.25+) Zinit servers through automatic protocol detection.
Add this to your Cargo.toml:
[dependencies]
zinit-client = "0.4.0"
use zinit_client::ZinitClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = ZinitClient::new("/var/run/zinit.sock");
// List all services
let services = client.list().await?;
println!("Services: {:?}", services);
// Start a service
client.start("my-service").await?;
// Get service status
let status = client.status("my-service").await?;
println!("Status: {:?}", status);
Ok(())
}
// List all services
let services = client.list().await?;
// Service lifecycle
client.start("service-name").await?;
client.stop("service-name").await?;
client.restart("service-name").await?;
// Get detailed status
let status = client.status("service-name").await?;
// Create/delete services (if supported by server)
client.create_service("name", config).await?;
client.delete_service("name").await?;
Run the demo to see the universal interface in action:
cargo run --example <example_name> <sock_path>
For detailed API documentation, visit docs.rs/zinit-client.
This project is licensed under the MIT License - see the LICENSE file for details.