#[non_exhaustive]pub struct CommandInfo {
pub name: String,
pub plugin: Option<String>,
pub description: Option<String>,
pub args: Vec<CommandArg>,
pub return_type: Option<String>,
pub is_async: bool,
pub intent: Option<String>,
pub category: Option<String>,
pub examples: Vec<String>,
}Expand description
Metadata for a registered Tauri command, including intent and schema information.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringFully qualified command name (e.g. “get_settings”).
plugin: Option<String>Plugin namespace, if the command belongs to a Tauri plugin.
description: Option<String>Human-readable description of what the command does.
args: Vec<CommandArg>Ordered list of arguments the command accepts.
return_type: Option<String>Rust return type as a string (e.g. “Result<Settings, Error>”).
is_async: boolWhether the command handler is async.
intent: Option<String>Natural-language intent phrase for NL-to-command resolution.
category: Option<String>Grouping category (e.g. “settings”, “counter”).
examples: Vec<String>Example natural-language queries that should resolve to this command.
Implementations§
Source§impl CommandInfo
impl CommandInfo
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Creates a new command with the given name and all optional fields set to None/empty.
§Examples
use victauri_core::CommandInfo;
let cmd = CommandInfo::new("greet");
assert_eq!(cmd.name, "greet");
assert!(cmd.description.is_none());Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Sets the description.
Sourcepub fn with_intent(self, intent: impl Into<String>) -> Self
pub fn with_intent(self, intent: impl Into<String>) -> Self
Sets the intent phrase for natural-language resolution.
Sourcepub fn with_category(self, category: impl Into<String>) -> Self
pub fn with_category(self, category: impl Into<String>) -> Self
Sets the category.
Sourcepub fn with_plugin(self, plugin: impl Into<String>) -> Self
pub fn with_plugin(self, plugin: impl Into<String>) -> Self
Sets the plugin namespace.
Sourcepub fn with_args(self, args: Vec<CommandArg>) -> Self
pub fn with_args(self, args: Vec<CommandArg>) -> Self
Replaces the argument list.
Sourcepub fn with_arg(self, arg: CommandArg) -> Self
pub fn with_arg(self, arg: CommandArg) -> Self
Appends one argument.
Sourcepub fn with_return_type(self, return_type: impl Into<String>) -> Self
pub fn with_return_type(self, return_type: impl Into<String>) -> Self
Sets the Rust return type string.
Sourcepub fn with_async(self, is_async: bool) -> Self
pub fn with_async(self, is_async: bool) -> Self
Sets whether the command handler is async.
Sourcepub fn with_examples(self, examples: Vec<String>) -> Self
pub fn with_examples(self, examples: Vec<String>) -> Self
Replaces the example natural-language queries.
Sourcepub fn with_example(self, example: impl Into<String>) -> Self
pub fn with_example(self, example: impl Into<String>) -> Self
Appends one example natural-language query.