pub struct CommandMeta {
pub dry_run_prompt: 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.
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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Returns the “default value” for a type. Read more
impl Eq for CommandMeta
Source§impl PartialEq for CommandMeta
impl PartialEq for CommandMeta
Source§fn eq(&self, other: &CommandMeta) -> bool
fn eq(&self, other: &CommandMeta) -> bool
Tests for
self and other values to be equal, and is used by ==.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
Mutably borrows from an owned value. Read more