pub struct Command {Show 13 fields
pub id: String,
pub label: String,
pub description: Option<String>,
pub command: String,
pub args: Vec<String>,
pub env: HashMap<String, String>,
pub cwd: Option<PathBuf>,
pub category: CommandCategory,
pub priority: u8,
pub conditions: Vec<Condition>,
pub tags: Vec<String>,
pub requires_input: bool,
pub estimated_duration: Option<u32>,
}
Expand description
Represents a command that can be executed
Fields§
§id: String
Unique identifier for this command
label: String
Human-readable label for display
description: Option<String>
Optional description providing more context
command: String
The actual command to execute
args: Vec<String>
Command arguments
env: HashMap<String, String>
Environment variables to set
cwd: Option<PathBuf>
Working directory for execution
category: CommandCategory
Command category for grouping
priority: u8
Priority for sorting (higher = more important)
conditions: Vec<Condition>
Conditions that must be met for this command to be available
Tags for filtering and search
requires_input: bool
Whether this command requires user input
estimated_duration: Option<u32>
Estimated execution time in seconds
Implementations§
Source§impl Command
impl Command
Sourcepub fn builder(
id: impl Into<String>,
command: impl Into<String>,
) -> CommandBuilder
pub fn builder( id: impl Into<String>, command: impl Into<String>, ) -> CommandBuilder
Create a new command builder
Sourcepub async fn execute(&self) -> RazResult<ExecutionResult>
pub async fn execute(&self) -> RazResult<ExecutionResult>
Execute this command asynchronously
Sourcepub async fn execute_with_browser(
&self,
open_browser: bool,
browser: Option<String>,
) -> RazResult<ExecutionResult>
pub async fn execute_with_browser( &self, open_browser: bool, browser: Option<String>, ) -> RazResult<ExecutionResult>
Execute this command with browser launching options
Sourcepub fn is_available(&self, context: &ProjectContext) -> bool
pub fn is_available(&self, context: &ProjectContext) -> bool
Check if all conditions for this command are met
Sourcepub fn command_line(&self) -> String
pub fn command_line(&self) -> String
Get the full command line as a string
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Command
impl<'de> Deserialize<'de> for Command
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
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