Expand description
Async connection pool for managing NETCONF sessions to multiple devices.
DevicePool
├── Semaphore(max_connections) — global concurrency limit
├── devices: HashMap<name, DeviceConfig>
└── connections: HashMap<name, Vec<Client>> — idle pool per device
checkout("spine-01") → PoolGuard(Client) — auto-checkin on drop§Example
use rustnetconf::pool::{DevicePool, DeviceConfig};
use rustnetconf::transport::ssh::SshAuth;
use rustnetconf::Datastore;
let pool = DevicePool::builder()
.max_connections(50)
.add_device("spine-01", DeviceConfig {
host: "10.0.0.1:830".into(),
username: "admin".into(),
auth: SshAuth::Password("secret".into()),
vendor: None,
})
.build();
let mut conn = pool.checkout("spine-01").await?;
let config = conn.get_config(Datastore::Running).await?;
// conn auto-returned to pool when droppedStructs§
- Device
Config - Configuration for a single device in the pool.
- Device
Pool - Async connection pool for multi-device NETCONF operations.
- Device
Pool Builder - Builder for constructing a
DevicePool. - Pool
Guard - A checked-out connection from the pool.