From f1ed18e668a830646fe507ee33c4b010a1690342 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Wed, 1 Apr 2026 20:14:56 +0800 Subject: Add documentation for mingling_core --- mingling_core/src/asset/node.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mingling_core/src/asset/node.rs') diff --git a/mingling_core/src/asset/node.rs b/mingling_core/src/asset/node.rs index c8b7600..035d227 100644 --- a/mingling_core/src/asset/node.rs +++ b/mingling_core/src/asset/node.rs @@ -1,11 +1,16 @@ use just_fmt::kebab_case; +/// Represents a command node, used to match user-input command paths. +/// +/// The node consists of multiple parts, each separated by a dot (`.`), and automatically converted to kebab-case. +/// For example, the input string `"node.subnode"` will be converted to a node representation of `["node", "subnode"]`. #[derive(Debug, Default)] pub struct Node { node: Vec, } impl Node { + /// Append a new part to the node path. pub fn join(self, node: impl Into) -> Node { let mut new_node = self.node; new_node.push(node.into()); -- cgit