Trait libimagrt::runtime::IdPathProvider
source · pub trait IdPathProvider {
fn get_ids(matches: &ArgMatches<'_>) -> Vec<StoreId> ⓘ;
}Expand description
A trait for the path provider functionality
This trait can be implement on a type so that it can provide IDs when given a ArgMatches object.
It can be used with Runtime::ids() and libimagrt handles “stdin-provides-ids” cases automatically:
ⓘ
runtime.ids::<PathProvider>()?.iter().for_each(|id| /* ... */)libimagrt does not call the PathProvider if the ids are provided by piping to stdin.
Passed arguments
The arguments which are passed into the IdPathProvider::get_ids() function are the top level ArgMatches. Traversing might be required in the implementation of the ::get_ids() function.
Returns
In case of error, the IdPathProvider::get_ids() function should exit the application with the appropriate error message(s).
On success, the StoreId objects to operate on are returned from the ArgMatches.