Struct pacdef_core::Pacdef
source · pub struct Pacdef { /* private fields */ }Expand description
Most data that is required during runtime of the program.
Implementations§
source§impl Pacdef
impl Pacdef
sourcepub const fn new(args: ArgMatches, config: Config, groups: HashSet<Group>) -> Self
pub const fn new(args: ArgMatches, config: Config, groups: HashSet<Group>) -> Self
Creates a new Pacdef. config should be passed from Config::load, and args from
args::get.
sourcepub fn run_action_from_arg(self) -> Result<()>
pub fn run_action_from_arg(self) -> Result<()>
Run the action that was provided by the user as first argument.
For convenience sake, all called functions take a &self argument, even if
these are not strictly required.
Panics
Panics if the user passed an unexpected action. This means all fields from
crate::action::Action must be matched in this function.
Errors
This function propagates errors from the underlying functions.