Struct rustshop_env::Env
source · [−]pub struct Env { /* private fields */ }
Implementations
sourceimpl Env
impl Env
pub const NO_BIN_WRAP_ENV_NAME: &'static str = "RUSTSHOP_NO_BIN_WRAP"
pub fn load() -> EnvResult<Self>
pub fn write(&mut self) -> EnvResult<()>
pub fn get_shop_ref(&self) -> &ShopCfg
pub fn get_shop_mut(&mut self) -> &mut ShopCfg
pub fn get_shop_account_mut_opt<'env, 'name>(
&'env mut self,
name: &'name str
) -> Option<&'env mut ShopAccountCfg>
pub fn get_shop_account_mut<'env, 'name>(
&'env mut self,
name: &'name str
) -> EnvResult<&'env mut ShopAccountCfg>
pub fn get_shop_account_ref_opt<'env, 'name>(
&'env self,
name: &'name str
) -> Option<&'env ShopAccountCfg>
pub fn get_shop_account_ref<'env, 'name>(
&'env self,
name: &'name str
) -> EnvResult<&'env ShopAccountCfg>
pub fn get_account_ref_opt<'env, 'name>(
&'env self,
name: &'name str
) -> EnvResult<Option<EnvAccountRef<'env>>>
pub fn get_account_mut_opt<'env, 'name>(
&'env mut self,
name: &'name str
) -> EnvResult<Option<EnvAccountMut<'env>>>
pub fn get_account_ref<'env, 'name>(
&'env self,
name: &'name str
) -> EnvResult<EnvAccountRef<'env>>
pub fn get_account_mut<'env, 'name>(
&'env mut self,
name: &'name str
) -> EnvResult<EnvAccountMut<'env>>
pub fn add_account(
&mut self,
name: &str,
aws_region: &str
) -> EnvResult<ShopAccountCfg>
pub fn add_cluster(
&mut self,
account_name: &str,
cluster_name: &str
) -> EnvResult<ShopClusterCfg>
pub fn configure_account(
&mut self,
name: &str,
profile: &str
) -> EnvResult<AccountCfg>
pub fn configure_cluster(
&mut self,
account_name: Option<&str>,
name: &str,
ctx: &str
) -> EnvResult<ClusterCfg>
sourcepub fn normalize_context_path(
&self,
context_path: Option<ContextYaml>,
widen: bool
) -> EnvResult<ContextYaml>
pub fn normalize_context_path(
&self,
context_path: Option<ContextYaml>,
widen: bool
) -> EnvResult<ContextYaml>
Narrow down context to elements that actually exist Widen up context when only one sub-element is availble
pub fn resolve_context_path(
&self,
context_path: &ContextYaml
) -> EnvResult<EnvContext>
pub fn switch_account(&mut self, name: &str) -> EnvResult<EnvContext>
pub fn switch_cluster(&mut self, name: &str) -> EnvResult<EnvContext>
pub fn switch_namespace(&mut self, name: &str) -> EnvResult<EnvContext>
pub fn get_context(&self) -> EnvResult<EnvContext>
sourcepub fn get_context_account(&self) -> EnvResult<EnvContext>
pub fn get_context_account(&self) -> EnvResult<EnvContext>
Like get_context
, but will error out if account not set
sourcepub fn get_context_cluster(&self) -> EnvResult<EnvContext>
pub fn get_context_cluster(&self) -> EnvResult<EnvContext>
Like get_context
, but will error out if account not set
pub fn write_ctx_info_to<W>(
&self,
context: EnvContext,
w: &mut W
) -> Result<(), Error> where
W: Write,
pub fn shop_cfg(&self) -> &ShopCfg
Methods from Deref<Target = EnvRoot>
pub const ROOT_SUBDIR: &'static str = ".rustshop"
pub fn add_shop(&self, name: String, domain: String) -> EnvResult<()>
pub fn root_cfg_dir(&self) -> PathBuf
pub fn shop_yaml_path(&self) -> PathBuf
pub fn user_yaml_path(&self) -> PathBuf
pub fn context_yaml_path(&self) -> PathBuf
pub fn load_shop_cfg_opt(&self) -> EnvResult<Option<ShopCfg>>
pub fn load_user_yaml_opt(&self) -> EnvResult<Option<UserYaml>>
pub fn load_user_yaml(&self) -> EnvResult<UserYaml>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Env
impl Send for Env
impl Sync for Env
impl Unpin for Env
impl UnwindSafe for Env
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more