pub struct NewModuleOptions {Show 17 fields
pub target_dir: PathBuf,
pub name: String,
pub template: TemplateSource,
pub branch: Option<String>,
pub package_name: Option<String>,
pub package_description: Option<String>,
pub package_authors: Vec<String>,
pub module_label: Option<String>,
pub module_title: Option<String>,
pub module_summary: Option<String>,
pub program_name: Option<String>,
pub extra_programs: Vec<String>,
pub repository_url: Option<String>,
pub asimov_version: Option<String>,
pub publish: bool,
pub vcs: Option<String>,
pub create_program: bool,
}Available on crate feature
module only.Fields§
§target_dir: PathBuf§name: String§template: TemplateSource§branch: Option<String>§package_name: Option<String>§package_description: Option<String>§module_label: Option<String>§module_title: Option<String>§module_summary: Option<String>§program_name: Option<String>§extra_programs: Vec<String>Additional programs to scaffold beyond program_name, added the same
way program::add_program would, right after the module itself is
generated.
repository_url: Option<String>§asimov_version: Option<String>§publish: bool§vcs: Option<String>§create_program: boolWhether to scaffold an initial program at all. Defaults to true;
set to false (via Self::without_program) to create a bare
module with no programs — add them later via program::add_program.
Implementations§
Source§impl NewModuleOptions
impl NewModuleOptions
pub fn new(target_dir: impl Into<PathBuf>, name: impl Into<String>) -> Self
pub fn template_path(self, path: impl Into<PathBuf>) -> Self
pub fn template_git(self, git: impl Into<String>) -> Self
Sourcepub fn without_program(self) -> Self
pub fn without_program(self) -> Self
Creates a bare module with no initial program.
Sourcepub fn programs(self, names: impl IntoIterator<Item = String>) -> Self
pub fn programs(self, names: impl IntoIterator<Item = String>) -> Self
Sets the module’s initial set of programs. Given an empty list, the
template’s own default program is used, unchanged (today’s
asimov-<name>-emitter). Given one or more names, the default is
skipped entirely and every name is added the same way
program::add_program would, right after the template is
generated — there is no special-cased “first” program.
Trait Implementations§
Source§impl Clone for NewModuleOptions
impl Clone for NewModuleOptions
Source§fn clone(&self) -> NewModuleOptions
fn clone(&self) -> NewModuleOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NewModuleOptions
impl RefUnwindSafe for NewModuleOptions
impl Send for NewModuleOptions
impl Sync for NewModuleOptions
impl Unpin for NewModuleOptions
impl UnsafeUnpin for NewModuleOptions
impl UnwindSafe for NewModuleOptions
Blanket Implementations§
impl<T> Any for Twhere
T: Any,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> CloneAny for T
impl<T> CloneAnySend for T
impl<T> CloneAnySendSync for T
impl<T> CloneAnySync for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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