pub struct HeadlessPluginHost;Expand description
A headless implementation of PluginHost for CLI use.
Provides real implementations for non-UI methods (HTTP, logging, notifications) and no-ops for UI-specific methods (panes, time range, custom visualizations).
Trait Implementations§
Source§impl PluginHost for HeadlessPluginHost
impl PluginHost for HeadlessPluginHost
Source§fn notify(&self, level: NotificationLevel, message: &str)
fn notify(&self, level: NotificationLevel, message: &str)
Send a notification to the user.
Source§fn request_repaint(&self)
fn request_repaint(&self)
Request a UI repaint.
Source§fn theme_name(&self) -> &'static str
fn theme_name(&self) -> &'static str
Get the current theme name as a string (e.g., “tokyo-night”, “catppuccin”).
Source§fn clipboard_write(&self, _text: &str) -> bool
fn clipboard_write(&self, _text: &str) -> bool
Write text to the system clipboard.
Returns true if successful, false if clipboard is unavailable.
Source§fn clipboard_read(&self) -> Option<String>
fn clipboard_read(&self) -> Option<String>
Read text from the system clipboard.
Returns None if clipboard is empty or unavailable.
Source§fn spawn(&self, _future: BoxFuture<()>)
fn spawn(&self, _future: BoxFuture<()>)
Spawn an async task (may not be available in all environments).
Source§fn http_get(
&self,
url: &str,
headers: &FxHashMap<String, String>,
) -> Result<HttpResponse, HttpError>
fn http_get( &self, url: &str, headers: &FxHashMap<String, String>, ) -> Result<HttpResponse, HttpError>
Perform an HTTP GET request.
Returns the response or an error message.
Source§fn http_post(
&self,
url: &str,
body: &str,
headers: &FxHashMap<String, String>,
) -> Result<HttpResponse, HttpError>
fn http_post( &self, url: &str, body: &str, headers: &FxHashMap<String, String>, ) -> Result<HttpResponse, HttpError>
Perform an HTTP POST request.
Returns the response or an error message.
Source§fn add_query_pane(&self, _query: &str, _title: Option<&str>)
fn add_query_pane(&self, _query: &str, _title: Option<&str>)
Add a query pane with the given PromQL query and optional title.
Source§fn add_logs_pane(&self)
fn add_logs_pane(&self)
Add a logs pane.
Source§fn add_tracing_pane(&self, _trace_id: Option<&str>)
fn add_tracing_pane(&self, _trace_id: Option<&str>)
Add a tracing pane, optionally pre-filled with a trace ID.
Source§fn add_terminal_pane(&self)
fn add_terminal_pane(&self)
Add a terminal pane (native only, no-op on WASM).
Source§fn add_sql_pane(&self)
fn add_sql_pane(&self)
Add a SQL pane.
Source§fn close_focused_pane(&self)
fn close_focused_pane(&self)
Close the currently focused pane.
Source§fn focus_pane(&self, _direction: &str)
fn focus_pane(&self, _direction: &str)
Focus pane in the given direction (“left”, “right”, “up”, “down”).
Source§fn set_time_range_preset(&self, _preset: &str)
fn set_time_range_preset(&self, _preset: &str)
Set time range to a preset (e.g., “5m”, “15m”, “1h”, “6h”, “24h”, “7d”).
Source§fn set_time_range_absolute(&self, _start_secs: f64, _end_secs: f64)
fn set_time_range_absolute(&self, _start_secs: f64, _end_secs: f64)
Set absolute time range (start and end in seconds since Unix epoch).
Source§fn get_time_range(&self) -> (f64, f64)
fn get_time_range(&self) -> (f64, f64)
Get the current time range as (start_secs, end_secs).
Note: This returns cached values; may not reflect real-time updates.
Source§fn register_custom_table_pane(&self, _config: CustomTableConfig)
fn register_custom_table_pane(&self, _config: CustomTableConfig)
Register a custom table pane type.
Source§fn add_custom_table_pane(&self, _pane_type: &str)
fn add_custom_table_pane(&self, _pane_type: &str)
Add an instance of a custom table pane.
Source§fn update_custom_table_data(&self, _pane_id: usize, _data: CustomTableData)
fn update_custom_table_data(&self, _pane_id: usize, _data: CustomTableData)
Update data for a custom table pane by pane ID.
Called by plugins when they have new data to display.
Source§fn update_custom_table_data_by_type(
&self,
_pane_type: &str,
_data: CustomTableData,
)
fn update_custom_table_data_by_type( &self, _pane_type: &str, _data: CustomTableData, )
Update data for all custom table panes of a given type.
Called by plugins when they have new data to display.
Source§fn register_custom_chart_pane(&self, _config: CustomChartConfig)
fn register_custom_chart_pane(&self, _config: CustomChartConfig)
Register a custom chart pane type.
Source§fn add_custom_chart_pane(&self, _pane_type: &str)
fn add_custom_chart_pane(&self, _pane_type: &str)
Add an instance of a custom chart pane.
Source§fn update_custom_chart_data_by_type(
&self,
_pane_type: &str,
_data: CustomChartData,
)
fn update_custom_chart_data_by_type( &self, _pane_type: &str, _data: CustomChartData, )
Update data for all custom chart panes of a given type.
Source§fn register_stat_pane(&self, _config: StatPaneConfig)
fn register_stat_pane(&self, _config: StatPaneConfig)
Register a custom stat pane type.
Source§fn add_stat_pane(&self, _pane_type: &str)
fn add_stat_pane(&self, _pane_type: &str)
Add an instance of a stat pane.
Source§fn update_stat_data_by_type(&self, _pane_type: &str, _data: StatPaneData)
fn update_stat_data_by_type(&self, _pane_type: &str, _data: StatPaneData)
Update data for all stat panes of a given type.
Source§fn register_gauge_pane(&self, _config: GaugePaneConfig)
fn register_gauge_pane(&self, _config: GaugePaneConfig)
Register a custom gauge pane type.
Source§fn add_gauge_pane(&self, _pane_type: &str)
fn add_gauge_pane(&self, _pane_type: &str)
Add an instance of a gauge pane.
Source§fn update_gauge_data_by_type(&self, _pane_type: &str, _data: GaugePaneData)
fn update_gauge_data_by_type(&self, _pane_type: &str, _data: GaugePaneData)
Update data for all gauge panes of a given type.
Source§fn get_focused_pane_info(&self) -> Option<FocusedPaneInfo>
fn get_focused_pane_info(&self) -> Option<FocusedPaneInfo>
Get information about the currently focused pane.
Returns None if no pane is focused.
Auto Trait Implementations§
impl Freeze for HeadlessPluginHost
impl RefUnwindSafe for HeadlessPluginHost
impl Send for HeadlessPluginHost
impl Sync for HeadlessPluginHost
impl Unpin for HeadlessPluginHost
impl UnsafeUnpin for HeadlessPluginHost
impl UnwindSafe for HeadlessPluginHost
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more