1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//! # Zinit Client
//!
//! A Rust client library for interacting with the [Zinit](https://github.com/threefoldtech/zinit) service manager.
//!
//! ## Features
//!
//! - Complete API coverage for all Zinit operations
//! - Robust error handling with custom error types
//! - Automatic reconnection on socket errors
//! - Retry mechanisms for transient failures
//! - Async/await support using Tokio
//! - Strongly typed service states and responses
//! - Efficient log streaming
//!
//! ## Usage
//!
//! ```rust,no_run
//! use zinit_client::{ZinitClient, Result};
//! use std::collections::HashMap;
//!
//! #[tokio::main]
//! async fn main() -> Result<()> {
//! // Create a client with default configuration
//! let client = ZinitClient::new("/var/run/zinit.sock");
//!
//! // List all services
//! let services = client.list().await?;
//! println!("Services: {:?}", services);
//!
//! // Start a service
//! client.start("nginx").await?;
//!
//! // Get service status
//! let status = client.status("nginx").await?;
//! println!("Nginx status: {:?}", status);
//!
//! Ok(())
//! }
//! ```
//!
//! ## Configuration
//!
//! You can customize the client behavior using `ClientConfig`:
//!
//! ```rust,no_run
//! use zinit_client::{ZinitClient, ClientConfig};
//! use std::time::Duration;
//!
//! let config = ClientConfig {
//! socket_path: "/var/run/zinit.sock".into(),
//! connection_timeout: Duration::from_secs(5),
//! operation_timeout: Duration::from_secs(30),
//! max_retries: 3,
//! retry_delay: Duration::from_millis(100),
//! max_retry_delay: Duration::from_secs(5),
//! retry_jitter: true,
//! };
//!
//! let client = ZinitClient::with_config(config);
//! ```
// Re-export public items
pub use ;
pub use ;
pub use ;
pub use RetryStrategy;
// Re-export futures for working with streams
pub use StreamExt;