Struct wasmer_cli::commands::init::Init
source · pub struct Init {Show 13 fields
env: WasmerEnv,
pub lib: bool,
pub bin: bool,
pub empty: bool,
pub overwrite: bool,
pub quiet: bool,
pub namespace: Option<String>,
pub package_name: Option<String>,
pub version: Option<Version>,
pub manifest_path: Option<PathBuf>,
pub template: Option<Template>,
pub include: Vec<String>,
pub out: Option<PathBuf>,
}
Expand description
CLI args for the wasmer init
command
Fields§
§env: WasmerEnv
§lib: bool
Initialize wasmer.toml for a library package
bin: bool
Initialize wasmer.toml for a binary package
empty: bool
Initialize an empty wasmer.toml
overwrite: bool
Force overwriting the wasmer.toml, even if it already exists
quiet: bool
Don’t display debug output
namespace: Option<String>
Namespace to init with, default = current logged in user or _
package_name: Option<String>
Package name to init with, default = Cargo.toml name or current directory name
version: Option<Version>
Version of the initialized package
manifest_path: Option<PathBuf>
If the manifest-path
is a Cargo.toml, use that file to initialize the wasmer.toml
template: Option<Template>
Add default dependencies for common packages
include: Vec<String>
Include file paths into the target container filesystem
out: Option<PathBuf>
Directory of the output file name. wasmer init will error if the target dir already contains a wasmer.toml. Also sets the package name.
Implementations§
source§impl Init
impl Init
sourcefn write_wasmer_toml(path: &PathBuf, toml: &Manifest) -> Result<(), Error>
fn write_wasmer_toml(path: &PathBuf, toml: &Manifest) -> Result<(), Error>
Writes the metadata to a wasmer.toml file, making sure we include the
NOTE
so people get a link to the registry docs.
fn target_file(&self) -> Result<(String, PathBuf), Error>
fn get_filesystem_mapping( include: &[String], ) -> impl Iterator<Item = (String, PathBuf)> + '_
fn get_command(modules: &[Module], bin_or_lib: BinOrLib) -> Vec<Command>
sourcefn get_dependencies(template: Option<&Template>) -> IndexMap<String, VersionReq>
fn get_dependencies(template: Option<&Template>) -> IndexMap<String, VersionReq>
Returns the dependencies based on the --template
flag
fn get_bin_or_lib(&self) -> Result<BinOrLib, Error>
sourcefn get_bindings(
target_file: &Path,
bin_or_lib: BinOrLib,
) -> Option<GetBindingsResult>
fn get_bindings( target_file: &Path, bin_or_lib: BinOrLib, ) -> Option<GetBindingsResult>
Get bindings returns the first .wai / .wit file found and optionally takes a warning callback that is triggered when > 1 .wai files are found
Trait Implementations§
source§impl Args for Init
impl Args for Init
source§fn group_id() -> Option<Id>
fn group_id() -> Option<Id>
ArgGroup::id
][crate::ArgGroup::id] for this set of argumentssource§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
source§impl AsyncCliCommand for Init
impl AsyncCliCommand for Init
source§impl FromArgMatches for Init
impl FromArgMatches for Init
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
.source§impl Parser for Init
impl Parser for Init
§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
§fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
Auto Trait Implementations§
impl Freeze for Init
impl RefUnwindSafe for Init
impl Send for Init
impl Sync for Init
impl Unpin for Init
impl UnwindSafe for Init
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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