pub struct CommandMeta {
pub dry_run_prompt: bool,
pub handles_dry_run: bool,
pub auth_metadata: BTreeMap<String, String>,
pub scopes: Vec<String>,
}Expand description
Per-command metadata consumed by middleware.
Command specs build this metadata automatically. Applications can also
adjust it through CliConfig::meta_resolver.
Fields§
§dry_run_prompt: boolWhether --dry-run should short-circuit command business logic.
handles_dry_run: boolWhether the command handles --dry-run itself instead of being
generically short-circuited. See
CommandSpec::handles_dry_run.
auth_metadata: BTreeMap<String, String>Provider-specific auth metadata.
scopes: Vec<String>OAuth-style scopes derived from auth_metadata["scopes"].
Implementations§
Source§impl CommandMeta
impl CommandMeta
Sourcepub fn tier(&self) -> Tier
pub fn tier(&self) -> Tier
Returns the risk tier, defaulting to Tier::Read.
Sourcepub fn set_scopes(&mut self, scopes: Vec<String>)
pub fn set_scopes(&mut self, scopes: Vec<String>)
Sets the OAuth scopes, keeping scopes and
auth_metadata["scopes"] consistent.
scopes is documented as derived from auth_metadata["scopes"], so any
code that synthesizes or widens scopes (e.g. runtime step-up) should use
this rather than assigning the field directly, so metadata-aware providers
reading auth_metadata see the same set. An empty list removes the key.
Trait Implementations§
Source§impl Clone for CommandMeta
impl Clone for CommandMeta
Source§fn clone(&self) -> CommandMeta
fn clone(&self) -> CommandMeta
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CommandMeta
impl Debug for CommandMeta
Source§impl Default for CommandMeta
impl Default for CommandMeta
Source§fn default() -> CommandMeta
fn default() -> CommandMeta
impl Eq for CommandMeta
Source§impl PartialEq for CommandMeta
impl PartialEq for CommandMeta
impl StructuralPartialEq for CommandMeta
Auto Trait Implementations§
impl Freeze for CommandMeta
impl RefUnwindSafe for CommandMeta
impl Send for CommandMeta
impl Sync for CommandMeta
impl Unpin for CommandMeta
impl UnsafeUnpin for CommandMeta
impl UnwindSafe for CommandMeta
Blanket Implementations§
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.