pub struct UnifiService { /* private fields */ }Expand description
Business-logic facade over UnifiClient: fixed read endpoints plus
dynamic action dispatch via ActionDispatcher.
Consumers embedding this crate (CLI commands, MCP tools, HTTP handlers)
should depend on UnifiService, not UnifiClient directly — it is the
stable seam for adding cross-cutting behavior (result shaping, caching,
metrics) without touching every call site.
Implementations§
Source§impl UnifiService
impl UnifiService
Sourcepub fn new(client: UnifiClient) -> Self
pub fn new(client: UnifiClient) -> Self
Wraps an already-built UnifiClient.
Sourcepub async fn clients(&self) -> Result<Value>
pub async fn clients(&self) -> Result<Value>
Connected clients (wireless and wired).
§Errors
See crate::UnifiError for the failure cases this can return.
Sourcepub async fn devices(&self) -> Result<Value>
pub async fn devices(&self) -> Result<Value>
Network devices: APs, switches, gateways.
§Errors
See crate::UnifiError for the failure cases this can return.
Sourcepub async fn wlans(&self) -> Result<Value>
pub async fn wlans(&self) -> Result<Value>
WLAN (WiFi network) configurations.
§Errors
See crate::UnifiError for the failure cases this can return.
Sourcepub async fn events(&self, limit: Option<usize>) -> Result<Value>
pub async fn events(&self, limit: Option<usize>) -> Result<Value>
Recent events, truncated to limit entries when given.
§Errors
See crate::UnifiError for the failure cases this can return.
Sourcepub async fn execute(&self, request: ActionRequest) -> Result<Value>
pub async fn execute(&self, request: ActionRequest) -> Result<Value>
Runs a named, dynamically-dispatched action (see ActionDispatcher).
§Errors
See crate::UnifiError for the failure cases this can return.
Trait Implementations§
Source§impl Clone for UnifiService
impl Clone for UnifiService
Source§fn clone(&self) -> UnifiService
fn clone(&self) -> UnifiService
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more