Struct wasmer_cli::config::env::WasmerEnv
source · pub struct WasmerEnv {
wasmer_dir: PathBuf,
pub(crate) cache_dir: PathBuf,
pub(crate) registry: Option<UserRegistry>,
token: Option<String>,
}
Expand description
Command-line flags for determining the local “Wasmer Environment”.
This is where you access $WASMER_DIR
, the $WASMER_DIR/wasmer.toml
config
file, and specify the current registry.
Fields§
§wasmer_dir: PathBuf
Set Wasmer’s home directory
cache_dir: PathBuf
The directory cached artefacts are saved to.
registry: Option<UserRegistry>
The registry to fetch packages from (inferred from the environment by default)
token: Option<String>
The API token to use when communicating with the registry (inferred from the environment by default)
Implementations§
source§impl WasmerEnv
impl WasmerEnv
pub fn new( wasmer_dir: PathBuf, cache_dir: PathBuf, token: Option<String>, registry: Option<UserRegistry>, ) -> Self
sourcepub fn registry_public_url(&self) -> Result<Url, Error>
pub fn registry_public_url(&self) -> Result<Url, Error>
Get the “public” url of the current registry (e.g. “https://wasmer.io” instead of “https://registry.wasmer.io/graphql”).
sourcepub fn registry_endpoint(&self) -> Result<Url, Error>
pub fn registry_endpoint(&self) -> Result<Url, Error>
Get the GraphQL endpoint used to query the registry.
sourcepub fn config(&self) -> Result<WasmerConfig, Error>
pub fn config(&self) -> Result<WasmerConfig, Error>
Load the current Wasmer config.
sourcepub fn proxy(&self) -> Result<Option<Proxy>, Error>
pub fn proxy(&self) -> Result<Option<Proxy>, Error>
Returns the proxy specified in wasmer config if present
sourcepub fn get_token_opt(&self) -> Option<&str>
pub fn get_token_opt(&self) -> Option<&str>
Retrieve the specified token.
NOTE: In contrast to Self::token
, this will not fall back to loading
the token from the confg file.
pub fn client_unauthennticated(&self) -> Result<WasmerClient, Error>
pub fn client(&self) -> Result<WasmerClient, Error>
Trait Implementations§
source§impl Args for WasmerEnv
impl Args for WasmerEnv
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 FromArgMatches for WasmerEnv
impl FromArgMatches for WasmerEnv
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 WasmerEnv
impl Parser for WasmerEnv
§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>
source§impl PartialEq for WasmerEnv
impl PartialEq for WasmerEnv
impl StructuralPartialEq for WasmerEnv
Auto Trait Implementations§
impl Freeze for WasmerEnv
impl RefUnwindSafe for WasmerEnv
impl Send for WasmerEnv
impl Sync for WasmerEnv
impl Unpin for WasmerEnv
impl UnwindSafe for WasmerEnv
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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