//! Psutil version plugin. //! //! The Rust rewrite does not use psutil; the plugin is kept for drop-in //! compatibility of the stats schema and reports "N/A". use crate::fields; use glances_core::plugin::{Plugin, PluginModel, UpdateContext}; use glances_core::{Args, Config}; use serde_json::{Value, json}; pub struct PsutilVersionPlugin { pub model: PluginModel, } impl PsutilVersionPlugin { pub fn new(config: &Config, args: &Args) -> Self { let model = PluginModel::new( "psutilversion", fields! {}, Vec::new(), Value::Null, config, args.time.unwrap_or(2.0), args.disable_history, args.disable_config_exec, ); Self { model } } } impl Plugin for PsutilVersionPlugin { fn name(&self) -> &str { "psutilversion" } fn model(&self) -> &PluginModel { &self.model } fn model_mut(&mut self) -> &mut PluginModel { &mut self.model } fn collect(&mut self, _ctx: &mut UpdateContext) -> anyhow::Result { Ok(json!("N/A")) } }