pub struct CommandContext {
pub credential: Option<Credential>,
pub args: ValueMap,
pub user_args: ValueMap,
pub command_path: String,
pub middleware: Middleware,
}Expand description
Runtime context passed to advanced command handlers.
Most commands can use RuntimeCommandSpec::new and receive just the
credential and effective args. Use this context when a command needs the
colon path, user-supplied args, or a snapshot of middleware state.
Fields§
§credential: Option<Credential>Credential resolved by middleware. No-auth commands receive None.
args: ValueMapEffective arguments, including defaults and framework-injected values.
user_args: ValueMapArguments explicitly supplied by the user.
command_path: StringColon-separated command path such as project:list.
middleware: MiddlewareMiddleware snapshot for this invocation.
Trait Implementations§
Source§impl Clone for CommandContext
impl Clone for CommandContext
Source§fn clone(&self) -> CommandContext
fn clone(&self) -> CommandContext
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 moreAuto Trait Implementations§
impl Freeze for CommandContext
impl !RefUnwindSafe for CommandContext
impl Send for CommandContext
impl Sync for CommandContext
impl Unpin for CommandContext
impl UnsafeUnpin for CommandContext
impl !UnwindSafe for CommandContext
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