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: boolCreate 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
Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Assign values from ArgMatches to self.
fn parse_from<I, T>(itr: I) -> Self where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn parse_from<I, T>(itr: I) -> Self where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Parse from iterator, exit on error
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error> where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error> where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Parse from iterator, return Err on error.
fn update_from<I, T>(&mut self, itr: I) where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn update_from<I, T>(&mut self, itr: I) where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Update from iterator, exit on error
fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error> where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error> where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Update from iterator, return Err on error.