pub struct TemplatePath {
pub auto_path: Option<String>,
pub subfolder: Option<String>,
pub test: bool,
pub git: Option<String>,
pub branch: Option<String>,
pub tag: Option<String>,
pub revision: Option<String>,
pub path: Option<String>,
pub favorite: Option<String>,
}Fields§
§auto_path: Option<String>Auto attempt to use as either --git or --favorite. If either is specified explicitly,
use as subfolder.
subfolder: Option<String>Specifies the subfolder within the template repository to be used as the actual template.
test: boolExpand $CWD as a template, then run cargo test on the expansion (set
$CARGO_GENERATE_TEST_CMD to override test command).
implies –verbose
Any arguments given after the --test argument, will be used as arguments for the test
command.
git: Option<String>Git repository to clone template from. Can be a URL (like
https://github.com/rust-cli/cli-template), a path (relative or absolute), or an
owner/repo abbreviated GitHub URL (like rust-cli/cli-template).
Note that cargo generate will first attempt to interpret the owner/repo form as a
relative path and only try a GitHub URL if the local path doesn’t exist.
branch: Option<String>Branch to use when installing from git
tag: Option<String>Tag to use when installing from git
revision: Option<String>Git revision to use when installing from git (e.g. a commit hash)
path: Option<String>Local path to copy the template from. Can not be specified together with –git.
favorite: Option<String>Generate a favorite template as defined in the config. In case the favorite is undefined,
use in place of the --git option, otherwise specifies the subfolder
Implementations§
Source§impl TemplatePath
impl TemplatePath
Sourcepub fn any_path(&self) -> &str
pub fn any_path(&self) -> &str
§Panics
Will panic if no path to a template has been set at all, which is never if Clap is initialized properly.
pub const fn git(&self) -> Option<&(impl AsRef<str> + '_)>
pub const fn branch(&self) -> Option<&(impl AsRef<str> + '_)>
pub const fn tag(&self) -> Option<&(impl AsRef<str> + '_)>
pub const fn revision(&self) -> Option<&(impl AsRef<str> + '_)>
pub const fn path(&self) -> Option<&(impl AsRef<str> + '_)>
pub const fn favorite(&self) -> Option<&(impl AsRef<str> + '_)>
pub const fn auto_path(&self) -> Option<&(impl AsRef<str> + '_)>
pub const fn subfolder(&self) -> Option<&(impl AsRef<str> + '_)>
Trait Implementations§
Source§impl Args for TemplatePath
impl Args for TemplatePath
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl Clone for TemplatePath
impl Clone for TemplatePath
Source§fn clone(&self) -> TemplatePath
fn clone(&self) -> TemplatePath
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TemplatePath
impl Debug for TemplatePath
Source§impl Default for TemplatePath
impl Default for TemplatePath
Source§fn default() -> TemplatePath
fn default() -> TemplatePath
Source§impl FromArgMatches for TemplatePath
impl FromArgMatches for TemplatePath
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Auto Trait Implementations§
impl Freeze for TemplatePath
impl RefUnwindSafe for TemplatePath
impl Send for TemplatePath
impl Sync for TemplatePath
impl Unpin for TemplatePath
impl UnwindSafe for TemplatePath
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more