Skip to main content

CommandModePolicyContext

Trait CommandModePolicyContext 

Source
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§

Source

fn mode(&self) -> CommandMode

Source

fn set_mode(&mut self, mode: CommandMode)

Source

fn approval_mode(&self) -> CommandApprovalMode

Source

fn allow_shell(&self) -> bool

Source

fn set_shell_access(&mut self, allow: bool)

Source

fn policy_locked(&self) -> bool

Source

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).

Source

fn select_yolo_compat(&mut self) -> CommandModeSelection

Apply the legacy YOLO alias (invisible Act + full access).

Source

fn mode_startup_default_receipt(&self, mode: CommandMode) -> String

The receipt shown when the same mode was persisted as the default.

Source

fn setting_locked_mode_message(&self) -> String

The refusal text when a locked policy blocks the change.

Source

fn mode_label(&self, mode: CommandMode) -> String

Localized display name for a mode (e.g. Work, Plan).

Source

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".

Implementors§