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§
§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.
Trait Implementations§
Source§impl Clone for CommandInfo
impl Clone for CommandInfo
Source§fn clone(&self) -> CommandInfo
fn clone(&self) -> CommandInfo
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CommandInfo
impl PartialEq for CommandInfo
Source§fn eq(&self, other: &CommandInfo) -> bool
fn eq(&self, other: &CommandInfo) -> bool
Tests for
self and other values to be equal, and is used by ==.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,
Serialize this value into the given Serde serializer. Read more
impl Eq for CommandInfo
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
Mutably borrows from an owned value. Read more