pub enum InputCommand {
Approve {
approval_id: Option<String>,
},
Reject {
approval_id: Option<String>,
reason: Option<String>,
},
Pause,
Resume,
Steer {
message: String,
},
Quit,
Veto,
Empty,
ComponentMessage {
target: String,
message: String,
},
Unknown {
input: String,
},
}Expand description
Parsed input command from Human.
Variants§
Approve
Approve a pending request.
Fields
Reject
Reject a pending request.
Fields
Pause
Pause execution.
Resume
Resume paused execution.
Steer
Steer with a message.
Quit
Graceful quit.
Veto
Emergency stop (Veto).
Empty
Empty input (blank line).
Distinct from Unknown - indicates user pressed Enter without input.
ComponentMessage
Direct message to a specific component.
Format: @component_name message
Routes to the named component only, bypassing broadcast.
Fields
Unknown
Unknown or invalid input.
Implementations§
Source§impl InputCommand
impl InputCommand
Sourcepub fn to_signal(
&self,
principal: Principal,
default_approval_id: Option<&str>,
) -> Option<Signal>
pub fn to_signal( &self, principal: Principal, default_approval_id: Option<&str>, ) -> Option<Signal>
Converts the command to a Signal if applicable.
Some commands (like Quit, Unknown) don’t map to signals.
§Arguments
principal- The Human principal sending the signaldefault_approval_id- Default approval ID if none specified
Sourcepub fn is_approval(&self) -> bool
pub fn is_approval(&self) -> bool
Returns true if this is an approval command.
Sourcepub fn is_rejection(&self) -> bool
pub fn is_rejection(&self) -> bool
Returns true if this is a rejection command.
Sourcepub fn is_hil_response(&self) -> bool
pub fn is_hil_response(&self) -> bool
Returns true if this is a HIL response (approve or reject).
Trait Implementations§
Source§impl Clone for InputCommand
impl Clone for InputCommand
Source§fn clone(&self) -> InputCommand
fn clone(&self) -> InputCommand
Returns a duplicate of the value. Read more
1.0.0 · 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 InputCommand
impl Debug for InputCommand
Source§impl PartialEq for InputCommand
impl PartialEq for InputCommand
impl Eq for InputCommand
impl StructuralPartialEq for InputCommand
Auto Trait Implementations§
impl Freeze for InputCommand
impl RefUnwindSafe for InputCommand
impl Send for InputCommand
impl Sync for InputCommand
impl Unpin for InputCommand
impl UnsafeUnpin for InputCommand
impl UnwindSafe for InputCommand
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
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
Compare self to
key and return true if they are equal.