1use crate::types::Error;
6use diagnostics_data::{Data, Inspect};
7use fidl_fuchsia_diagnostics::Selector;
8use fidl_fuchsia_sys2 as fsys2;
9use serde::Serialize;
10use std::fmt::Display;
11use std::future::Future;
12
13pub trait Command {
14 type Result: Serialize + Display;
15 fn execute<P: DiagnosticsProvider>(
16 self,
17 provider: &P,
18 ) -> impl Future<Output = Result<Self::Result, Error>>;
19}
20
21pub trait DiagnosticsProvider: Send + Sync {
22 fn snapshot(
23 &self,
24 accessor: Option<&str>,
25 selectors: impl IntoIterator<Item = Selector>,
26 ) -> impl Future<Output = Result<Vec<Data<Inspect>>, Error>>;
27
28 fn get_accessor_paths(&self) -> impl Future<Output = Result<Vec<String>, Error>>;
30
31 fn realm_query(&self) -> &fsys2::RealmQueryProxy;
33}