Attribute Macro panda_macros::monitor

source ·
#[monitor]
Expand description

(Callback) Called when someone uses the plugin_cmd monitor command.

Callback ID: PANDA_CB_MONITOR

   Arguments:
    Monitor *mon:    a pointer to the Monitor
    const char *cmd: the command string passed to plugin_cmd

   Helper call location: TBA

   Return value:
    unused

   Notes:
    The command is passed as a single string. No parsing is performed
    on the string before it is passed to the plugin, so each plugin
    must parse the string as it deems appropriate (e.g. by using strtok
    and getopt) to do more complex option processing.
    It is recommended that each plugin implementing this callback respond
    to the "help" message by listing the commands supported by the plugin.
    Note that every loaded plugin will have the opportunity to respond to
    each plugin_cmd; thus it is a good idea to ensure that your plugin's
    monitor commands are uniquely named, e.g. by using the plugin name
    as a prefix ("sample_do_foo" rather than "do_foo").

Callback arguments: (&mut Monitor, *const u8, )

Example

use panda::prelude::*;

#[panda::monitor]
fn callback(_: &mut Monitor, _: *const u8, ) {
    // do stuff
}