Skip to content

Commit e4d75fd

Browse files
definition -> metadata
1 parent 67570c9 commit e4d75fd

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

crates/tauri-macros/src/command/wrapper.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -305,25 +305,25 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream {
305305
quote!(stringify!(#ident))
306306
};
307307

308-
let command_definition_name = if let Some(plugin_name) = plugin_name_value.as_deref() {
308+
let command_metadata_name = if let Some(plugin_name) = plugin_name_value.as_deref() {
309309
quote!(concat!("plugin:", #plugin_name, "|", #command_name_value))
310310
} else {
311311
command_name_value.clone()
312312
};
313-
let mut command_definition_arguments = Vec::new();
313+
let mut command_metadata_arguments = Vec::new();
314314
if let Err(error) = parse_args(
315315
&plugin_name,
316316
&function,
317317
&message,
318318
&acl,
319319
&attrs,
320-
Some(&mut command_definition_arguments),
320+
Some(&mut command_metadata_arguments),
321321
) {
322322
return error.into_compile_error().into();
323323
}
324-
let command_definition_docs = parse_docs(&function.attrs);
324+
let command_metadata_docs = parse_docs(&function.attrs);
325325
let root = attrs.root;
326-
let command_definition_deprecated = match parse_deprecated(&function.attrs, &root) {
326+
let command_metadata_deprecated = match parse_deprecated(&function.attrs, &root) {
327327
Ok(deprecated) => deprecated,
328328
Err(error) => return error.into_compile_error().into(),
329329
};
@@ -350,12 +350,12 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream {
350350
#maybe_macro_export
351351
#[doc(hidden)]
352352
macro_rules! #wrapper {
353-
(@definition) => {
354-
#root::ipc::CommandDefinition {
355-
name: #command_definition_name,
356-
docs: #command_definition_docs,
357-
deprecated: #command_definition_deprecated,
358-
arguments: &[#(#command_definition_arguments),*],
353+
(@metadata) => {
354+
#root::ipc::CommandMetadata {
355+
name: #command_metadata_name,
356+
docs: #command_metadata_docs,
357+
deprecated: #command_metadata_deprecated,
358+
arguments: &[#(#command_metadata_arguments),*],
359359
}
360360
};
361361

@@ -635,7 +635,7 @@ fn parse_deprecated(attrs: &[Attribute], root: &TokenStream2) -> syn::Result<Tok
635635
.unwrap_or_else(|| quote!(::core::option::Option::None));
636636

637637
Ok(quote! {
638-
::core::option::Option::Some(#root::ipc::CommandDefinitionDeprecated {
638+
::core::option::Option::Some(#root::ipc::CommandMetadataDeprecated {
639639
note: #note,
640640
since: #since,
641641
})

crates/tauri/src/ipc/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -590,22 +590,22 @@ pub struct CallbackFn(pub u32);
590590
/// This can be used by frameworks built on Tauri to introspect the registered commands.
591591
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
592592
#[non_exhaustive]
593-
pub struct CommandDefinition {
593+
pub struct CommandMetadata {
594594
/// The name of the command including the prefix if it's defined within a plugin.
595595
/// This can be directly passed to `invoke`.
596596
pub name: &'static str,
597597
/// The Rust-doc comments for the command.
598598
pub docs: &'static str,
599599
/// Whether the command has a deprecated attribute.
600-
pub deprecated: Option<CommandDefinitionDeprecated>,
600+
pub deprecated: Option<CommandMetadataDeprecated>,
601601
/// The name of the arguments for this command.
602602
pub arguments: &'static [&'static str],
603603
}
604604

605605
/// Represents the Rust `#[deprecated]` attribute on a command.
606606
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
607607
#[non_exhaustive]
608-
pub struct CommandDefinitionDeprecated {
608+
pub struct CommandMetadataDeprecated {
609609
/// Deprecation note for the developer.
610610
pub note: Option<&'static str>,
611611
/// Rust version where the item became deprecated.

0 commit comments

Comments
 (0)