aboutsummaryrefslogtreecommitdiff
path: root/mingling_core/src/asset/node.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-04-01 20:14:56 +0800
committer魏曹先生 <1992414357@qq.com>2026-04-01 20:16:17 +0800
commitf1ed18e668a830646fe507ee33c4b010a1690342 (patch)
tree6d13b5ca65ec4df6b8df1c03df3c96301d435bbf /mingling_core/src/asset/node.rs
parent227e710fe716c8901ee02e670a57fb70eb3f222b (diff)
Add documentation for mingling_core
Diffstat (limited to 'mingling_core/src/asset/node.rs')
-rw-r--r--mingling_core/src/asset/node.rs5
1 files changed, 5 insertions, 0 deletions
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<String>,
}
impl Node {
+ /// Append a new part to the node path.
pub fn join(self, node: impl Into<String>) -> Node {
let mut new_node = self.node;
new_node.push(node.into());