pub struct Tool {
pub name: &'static str,
pub verb: &'static str,
pub section: u8,
pub about: &'static str,
pub usage_exit: u8,
pub command: fn() -> Command,
pub run: fn(&ArgMatches) -> Result<Outcome, CliError>,
}Expand description
One dotted name, and the program behind it.
Fields§
§name: &'static strThe name it is installed and invoked under: mkfs.<fs>.
verb: &'static strThe word that selects it after the repository name:
rust-fs-<fs> mkfs ....
section: u8Its manual section: 8 for mkfs.* and fsck.*, 1 otherwise.
about: &'static strOne line for the repository’s help.
usage_exit: u8The exit status of a wrong command line: 2 by the shared contract,
but a tool whose name promises another scheme keeps that scheme’s
(fsck.* answers 16, as fsck(8) documents, because 2 there means
“reboot”).
command: fn() -> CommandIts arguments. The name and version are set by the caller.
run: fn(&ArgMatches) -> Result<Outcome, CliError>Run it. Ok is printed on stdout in the format asked for; Err
as a structured error on stderr, with its code as the exit status.
Auto Trait Implementations§
impl Freeze for Tool
impl RefUnwindSafe for Tool
impl Send for Tool
impl Sync for Tool
impl Unpin for Tool
impl UnsafeUnpin for Tool
impl UnwindSafe for Tool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more