Skip to main content

## CommandFactory

# Trait CommandFactory

Source

    pub trait CommandFactory: Sized {
        // Required methods
        fn command() -> Command;
        fn command_for_update() -> Command;
    }

Expand description

Create a `Command` relevant for a user-defined container.

Derived as part of `Parser`.

## Required Methods§

Source

#### fn command() -> Command

Build a `Command` that can instantiate `Self`.

See `FromArgMatches::from_arg_matches_mut` for instantiating `Self`.

Source

#### fn command_for_update() -> Command

Build a `Command` that can update `self`.

See `FromArgMatches::update_from_arg_matches_mut` for updating `self`.

## Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

## Implementations on Foreign Types§

Source§

### impl<T> CommandFactory for Box<T>
where T: CommandFactory,

Source§

#### fn command() -> Command

Source§

#### fn command_for_update() -> Command

## Implementors§