pub trait CommandModePolicyContext {
// Required methods
fn mode(&self) -> CommandMode;
fn set_mode(&mut self, mode: CommandMode);
fn approval_mode(&self) -> CommandApprovalMode;
fn allow_shell(&self) -> bool;
fn set_shell_access(&mut self, allow: bool);
fn policy_locked(&self) -> bool;
fn select_mode(&mut self, mode: CommandMode) -> CommandModeSelection;
fn select_yolo_compat(&mut self) -> CommandModeSelection;
fn mode_startup_default_receipt(&self, mode: CommandMode) -> String;
fn setting_locked_mode_message(&self) -> String;
fn mode_label(&self, mode: CommandMode) -> String;
fn yolo_compat_label(&self) -> String;
}Expand description
Operating mode, approval posture, shell access, and policy lock.
Required Methods§
fn mode(&self) -> CommandMode
fn set_mode(&mut self, mode: CommandMode)
fn approval_mode(&self) -> CommandApprovalMode
fn allow_shell(&self) -> bool
fn set_shell_access(&mut self, allow: bool)
fn policy_locked(&self) -> bool
Sourcefn select_mode(&mut self, mode: CommandMode) -> CommandModeSelection
fn select_mode(&mut self, mode: CommandMode) -> CommandModeSelection
Apply a mode selection the way /mode does, reporting which of the
three outcomes occurred (changed, same-but-persisted, refused).
Sourcefn select_yolo_compat(&mut self) -> CommandModeSelection
fn select_yolo_compat(&mut self) -> CommandModeSelection
Apply the legacy YOLO alias (invisible Act + full access).
Sourcefn mode_startup_default_receipt(&self, mode: CommandMode) -> String
fn mode_startup_default_receipt(&self, mode: CommandMode) -> String
The receipt shown when the same mode was persisted as the default.
Sourcefn setting_locked_mode_message(&self) -> String
fn setting_locked_mode_message(&self) -> String
The refusal text when a locked policy blocks the change.
Sourcefn mode_label(&self, mode: CommandMode) -> String
fn mode_label(&self, mode: CommandMode) -> String
Localized display name for a mode (e.g. Work, Plan).
Sourcefn yolo_compat_label(&self) -> String
fn yolo_compat_label(&self) -> String
Localized label for the legacy YOLO alias (Full Access (Work)).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".