Skip to main content

Module api

Module api 

Source
Expand description

Thin wrapper around bee::Client that binds it to a configured NodeConfig. The cockpit talks to Bee through one ApiClient per active profile.

Construction:

use crate::api::ApiClient;
let client = ApiClient::from_node(&node_config)?;
let rtt = client.bee().ping().await?;

Multi-node UX (v0.4) will hold a HashMap<String, ApiClient> keyed by node name; the screen-level :context command swaps the active key.

Structs§

ApiClient
Active connection to one Bee node. Cheap to clone (bee::Client is Arc<Inner> under the hood).