#[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>) -> CommandInfo
pub fn new(name: impl Into<String>) -> CommandInfo
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>) -> CommandInfo
pub fn with_description(self, description: impl Into<String>) -> CommandInfo
Sets the description.
Sourcepub fn with_intent(self, intent: impl Into<String>) -> CommandInfo
pub fn with_intent(self, intent: impl Into<String>) -> CommandInfo
Sets the intent phrase for natural-language resolution.
Sourcepub fn with_category(self, category: impl Into<String>) -> CommandInfo
pub fn with_category(self, category: impl Into<String>) -> CommandInfo
Sets the category.
Sourcepub fn with_plugin(self, plugin: impl Into<String>) -> CommandInfo
pub fn with_plugin(self, plugin: impl Into<String>) -> CommandInfo
Sets the plugin namespace.
Sourcepub fn with_args(self, args: Vec<CommandArg>) -> CommandInfo
pub fn with_args(self, args: Vec<CommandArg>) -> CommandInfo
Replaces the argument list.
Sourcepub fn with_arg(self, arg: CommandArg) -> CommandInfo
pub fn with_arg(self, arg: CommandArg) -> CommandInfo
Appends one argument.
Sourcepub fn with_return_type(self, return_type: impl Into<String>) -> CommandInfo
pub fn with_return_type(self, return_type: impl Into<String>) -> CommandInfo
Sets the Rust return type string.
Sourcepub fn with_async(self, is_async: bool) -> CommandInfo
pub fn with_async(self, is_async: bool) -> CommandInfo
Sets whether the command handler is async.
Sourcepub fn with_examples(self, examples: Vec<String>) -> CommandInfo
pub fn with_examples(self, examples: Vec<String>) -> CommandInfo
Replaces the example natural-language queries.
Sourcepub fn with_example(self, example: impl Into<String>) -> CommandInfo
pub fn with_example(self, example: impl Into<String>) -> CommandInfo
Appends one example natural-language query.
Trait Implementations§
Source§impl Clone for CommandInfo
impl Clone for CommandInfo
Source§fn clone(&self) -> CommandInfo
fn clone(&self) -> CommandInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CommandInfo
impl Debug for CommandInfo
Source§impl<'de> Deserialize<'de> for CommandInfo
impl<'de> Deserialize<'de> for CommandInfo
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CommandInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CommandInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for CommandInfo
Source§impl PartialEq for CommandInfo
impl PartialEq for CommandInfo
Source§impl Serialize for CommandInfo
impl Serialize for CommandInfo
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for CommandInfo
Auto Trait Implementations§
impl Freeze for CommandInfo
impl RefUnwindSafe for CommandInfo
impl Send for CommandInfo
impl Sync for CommandInfo
impl Unpin for CommandInfo
impl UnsafeUnpin for CommandInfo
impl UnwindSafe for CommandInfo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
Source§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.