CmdCtxMpnf

Struct CmdCtxMpnf 

Source
pub struct CmdCtxMpnf<'ctx, CmdCtxTypesT>
where CmdCtxTypesT: CmdCtxTypes,
{ pub output: OwnedOrMutRef<'ctx, CmdCtxTypesT::Output>, pub fields: CmdCtxMpnfFields<'ctx, CmdCtxTypesT>, }
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.

§fields: CmdCtxMpnfFields<'ctx, CmdCtxTypesT>

Inner fields without the output.

§Design

This is necessary so that the output can be separated from the fields during execution.

Implementations§

Source§

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

Source

pub fn builder<'ctx_local>() -> CmdCtxMpnfParamsBuilder<'ctx_local, CmdCtxTypesT>

Returns a [CmdCtxMpnfParamsBuilder] to construct this command context.

Source

pub fn output(&self) -> &CmdCtxTypesT::Output

Returns a reference to the output.

Source

pub fn output_mut(&mut self) -> &mut CmdCtxTypesT::Output

Returns a mutable reference to the output.

Source

pub fn fields(&self) -> &CmdCtxMpnfFields<'_, CmdCtxTypesT>

Returns a reference to the fields.

Source

pub fn fields_mut(&mut self) -> &mut CmdCtxMpnfFields<'ctx, CmdCtxTypesT>

Returns a mutable reference to the fields.

Trait Implementations§

Source§

impl<'ctx, CmdCtxTypesT> Debug for CmdCtxMpnf<'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 CmdCtxMpnf<'ctx, CmdCtxTypesT>
where <CmdCtxTypesT as CmdCtxTypes>::Output: Freeze,

§

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

§

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

§

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

§

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

§

impl<'ctx, CmdCtxTypesT> !UnwindSafe for CmdCtxMpnf<'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.