Struct cargo_temp::Cli[][src]

pub struct Cli {
    pub dependencies: Vec<Dependency>,
    pub lib: bool,
    pub project_name: Option<String>,
    pub worktree_branch: Option<Option<String>>,
    pub git: Option<String>,
}
Expand description

This tool allow you to create a new Rust temporary project in a temporary directory.

The dependencies can be provided in arguments (e.g.cargo-temp anyhow tokio). When the shell is exited, the temporary directory is deleted unless you removed the file TO_DELETE.

Fields

dependencies: Vec<Dependency>

Dependencies to add to Cargo.toml.

The default version used is * but this can be replaced using =. E.g. cargo-temp anyhow=1.0.13

lib: bool

Create a library instead of a binary.

project_name: Option<String>

Name of the temporary crate.

worktree_branch: Option<Option<String>>

Create a temporary Git working tree based on the repository in the current directory.

git: Option<String>

Create a temporary clone of a Git repository.

Implementations

Trait Implementations

Parse from std::env::args_os(), exit on error

Parse from std::env::args_os(), return Err on error.

Parse from iterator, exit on error

Parse from iterator, return Err on error.

Formats the value using the given formatter. Read more

It’s common to have an “application context” struct (sometimes called config) that represents all the normalized values after being processed by the CLI. Read more

@TODO @release @docs

@TODO @release @docs

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.