Skip to main content

HeadlessPluginHost

Struct HeadlessPluginHost 

Source
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

Source§

fn notify(&self, level: NotificationLevel, message: &str)

Send a notification to the user.
Source§

fn request_repaint(&self)

Request a UI repaint.
Source§

fn log(&self, level: LogLevel, message: &str)

Log a message.
Source§

fn version(&self) -> &'static str

Get the host application version.
Source§

fn is_wasm(&self) -> bool

Check if running in WASM environment.
Source§

fn theme(&self) -> Theme

Get the current theme.
Source§

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

Write text to the system clipboard. Returns true if successful, false if clipboard is unavailable.
Source§

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<()>)

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>

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>

Perform an HTTP POST request. Returns the response or an error message.
Source§

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)

Add a logs pane.
Source§

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)

Add a terminal pane (native only, no-op on WASM).
Source§

fn add_sql_pane(&self)

Add a SQL pane.
Source§

fn close_focused_pane(&self)

Close the currently focused pane.
Source§

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)

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)

Set absolute time range (start and end in seconds since Unix epoch).
Source§

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)

Register a custom table pane type.
Source§

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)

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, )

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)

Register a custom chart pane type.
Source§

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, )

Update data for all custom chart panes of a given type.
Source§

fn register_stat_pane(&self, _config: StatPaneConfig)

Register a custom stat pane type.
Source§

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)

Update data for all stat panes of a given type.
Source§

fn register_gauge_pane(&self, _config: GaugePaneConfig)

Register a custom gauge pane type.
Source§

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)

Update data for all gauge panes of a given type.
Source§

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> MaybeSend for T
where T: Send,