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: boolInitialize wasmer.toml for a library package
bin: boolInitialize wasmer.toml for a binary package
empty: boolInitialize an empty wasmer.toml
overwrite: boolForce overwriting the wasmer.toml, even if it already exists
quiet: boolDon’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
Command] so it can instantiate self via
[FromArgMatches::update_from_arg_matches_mut] Read moreSource§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 UnsafeUnpin 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