Skip to main content

handle_admin_command

Function handle_admin_command 

Source
pub async fn handle_admin_command<S: StorageEngine>(
    cmd: &str,
    uptime_secs: u64,
    recent_log: &Arc<RwLock<VecDeque<LogEntry>>>,
    storage: &Arc<S>,
) -> Option<String>
Expand description

Execute an admin command and return a JSON string, or None for unknown commands.

The cmd parameter is everything after the __admin__: prefix. Commands may carry space-separated arguments, e.g. "LOGS 50 false".

§Arguments

  • cmd - Full command string including arguments.
  • uptime_secs - Server uptime at call time (seconds).
  • recent_log - The server’s recent-log ring buffer.
  • storage - Reference to the storage engine.