CmdCtxMpnfParams

Struct CmdCtxMpnfParams 

Source
pub struct CmdCtxMpnfParams<'ctx, CmdCtxTypesT>
where CmdCtxTypesT: CmdCtxTypes,
{ pub output: OwnedOrMutRef<'ctx, CmdCtxTypesT::Output>, pub interruptibility: Interruptibility<'static>, pub workspace: OwnedOrRef<'ctx, Workspace>, pub profile_filter_fn: Option<ProfileFilterFn>, pub workspace_params: WorkspaceParamsOpt<<CmdCtxTypesT as CmdCtxTypes>::WorkspaceParamsKey>, pub profile_to_profile_params: BTreeMap<Profile, ProfileParamsOpt<<CmdCtxTypesT as CmdCtxTypes>::ProfileParamsKey>>, }
Expand description

A command that works with multiple profiles, not scoped to a flow.

path/to/repo/.peace/envman
|- 📝 workspace_params.yaml    # ✅ can read or write `WorkspaceParams`
|
|- 🌏 internal_dev_a           # ✅ can list multiple `Profile`s
|   |- 📝 profile_params.yaml  # ✅ can read multiple `ProfileParams`
|   |
|   |- ..                      # ❌ cannot read or write `Flow` information
|
|- 🌏 customer_a_dev           # ✅
|   |- 📝 profile_params.yaml  # ✅
|
|- 🌏 customer_a_prod          # ✅
|   |- 📝 profile_params.yaml  # ✅
|
|- 🌏 workspace_init           # ✅ can list multiple `Profile`s
    |- 📝 profile_params.yaml  # ❌ cannot read profile params of different underlying type

§Capabilities

This kind of command can:

  • Read or write workspace parameters.
  • Read or write multiple profiles’ parameters – as long as they are of the same type (same struct).

This kind of command cannot:

Fields§

§output: OwnedOrMutRef<'ctx, CmdCtxTypesT::Output>

Output endpoint to return values / errors, and write progress information to.

See OutputWrite.

§interruptibility: Interruptibility<'static>

The interrupt channel receiver if this CmdExecution is interruptible.

§workspace: OwnedOrRef<'ctx, Workspace>

Workspace that the peace tool runs in.

§profile_filter_fn: Option<ProfileFilterFn>

Function to filter the profiles that are accessible by this command.

§workspace_params: WorkspaceParamsOpt<<CmdCtxTypesT as CmdCtxTypes>::WorkspaceParamsKey>

Workspace params.

§profile_to_profile_params: BTreeMap<Profile, ProfileParamsOpt<<CmdCtxTypesT as CmdCtxTypes>::ProfileParamsKey>>

Profile params for each profile.

Implementations§

Source§

impl<'ctx, CmdCtxTypesT> CmdCtxMpnfParams<'ctx, CmdCtxTypesT>
where CmdCtxTypesT: CmdCtxTypes,

Source

pub fn builder() -> CmdCtxMpnfParamsBuilder<'ctx, CmdCtxTypesT, ((), (), (), (), (WorkspaceParamsOpt<<CmdCtxTypesT as CmdCtxTypes>::WorkspaceParamsKey>,), (BTreeMap<Profile, ProfileParamsOpt<<CmdCtxTypesT as CmdCtxTypes>::ProfileParamsKey>>,))>

Create a builder for building CmdCtxMpnfParams. On the builder, call .output(...), .interruptibility(...)(optional), .workspace(...), .profile_filter_fn(...)(optional) to set the values of the fields. Finally, call .build_partial() to create the instance of CmdCtxMpnfParams.

Trait Implementations§

Source§

impl<'ctx, CmdCtxTypesT> Debug for CmdCtxMpnfParams<'ctx, CmdCtxTypesT>
where CmdCtxTypesT: CmdCtxTypes + Debug, CmdCtxTypesT::Output: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'ctx, CmdCtxTypesT> Freeze for CmdCtxMpnfParams<'ctx, CmdCtxTypesT>
where <CmdCtxTypesT as CmdCtxTypes>::Output: Freeze,

§

impl<'ctx, CmdCtxTypesT> !RefUnwindSafe for CmdCtxMpnfParams<'ctx, CmdCtxTypesT>

§

impl<'ctx, CmdCtxTypesT> !Send for CmdCtxMpnfParams<'ctx, CmdCtxTypesT>

§

impl<'ctx, CmdCtxTypesT> !Sync for CmdCtxMpnfParams<'ctx, CmdCtxTypesT>

§

impl<'ctx, CmdCtxTypesT> Unpin for CmdCtxMpnfParams<'ctx, CmdCtxTypesT>
where <CmdCtxTypesT as CmdCtxTypes>::WorkspaceParamsKey: Unpin,

§

impl<'ctx, CmdCtxTypesT> !UnwindSafe for CmdCtxMpnfParams<'ctx, CmdCtxTypesT>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.