pub trait DashboardSource {
// Required methods
fn status(&self) -> RunStatus;
fn recent_metrics(&self, limit: usize) -> HashMap<String, MetricSnapshot>;
fn subscribe(&self, callback: SubscriptionCallback);
fn resource_usage(&self) -> ResourceSnapshot;
}Expand description
Dashboard data source trait.
Implement this trait to provide data for real-time dashboards.
Required Methods§
Sourcefn recent_metrics(&self, limit: usize) -> HashMap<String, MetricSnapshot>
fn recent_metrics(&self, limit: usize) -> HashMap<String, MetricSnapshot>
Get recent metrics, limited to limit points per metric.
Sourcefn subscribe(&self, callback: SubscriptionCallback)
fn subscribe(&self, callback: SubscriptionCallback)
Subscribe to metric updates.
Returns a receiver that will receive metric snapshots as they arrive. The callback is called with the metric key and latest value.
Sourcefn resource_usage(&self) -> ResourceSnapshot
fn resource_usage(&self) -> ResourceSnapshot
Get current resource usage.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".