pub trait PandaArgs {
const PLUGIN_NAME: &'static str;
// Required methods
fn from_panda_args() -> Self;
fn to_panda_args_str(&self) -> String;
fn to_panda_args(&self) -> Vec<(&'static str, String)>;
}
Expand description
A trait for allowing conversion to and from PANDA command line arguments. Should only be used with the provided derive macro.
§Example
use panda::prelude::*;
#[derive(PandaArgs)]
#[name = "my_plugin"]
struct MyPluginArgs {
file: String,
}
let args = MyPluginArgs::from_panda_args();
Required Associated Constants§
const PLUGIN_NAME: &'static str
Required Methods§
sourcefn from_panda_args() -> Self
fn from_panda_args() -> Self
Get an instance of this struct from the PANDA arguments for the given plugin
sourcefn to_panda_args_str(&self) -> String
fn to_panda_args_str(&self) -> String
Convert this struct into a string to be passed via PANDA command line arguments.
Used internally by Panda::plugin_args
.
sourcefn to_panda_args(&self) -> Vec<(&'static str, String)>
fn to_panda_args(&self) -> Vec<(&'static str, String)>
Convert this struct into a set of argument pairs to be passed to PANDA
Used internally by plugin_require
Object Safety§
This trait is not object safe.