summaryrefslogtreecommitdiff
path: root/components/rust/core/src/param.rs
diff options
context:
space:
mode:
authorzhang san <[email protected]>2025-12-08 18:34:25 +0800
committerGitHub <[email protected]>2025-12-08 18:34:25 +0800
commit69980f8b9d29b38dbd4ddf6373b4b45f3a138409 (patch)
tree21dd9a8ce80e3d30192e9ffa56ea39a199bae309 /components/rust/core/src/param.rs
parentcd1d47b87c5d47e131730e5506eb3ad77d357653 (diff)
Adding Rust Language Support for RT-Thread #10910
Diffstat (limited to 'components/rust/core/src/param.rs')
-rw-r--r--components/rust/core/src/param.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/components/rust/core/src/param.rs b/components/rust/core/src/param.rs
new file mode 100644
index 0000000000..3582a6430c
--- /dev/null
+++ b/components/rust/core/src/param.rs
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2006-2025, RT-Thread Development Team
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author notes
+ * 2025-10-10 foxglove Parameter module
+ */
+
+use alloc::vec::Vec;
+use core::iter::IntoIterator;
+use core::ops::Deref;
+
+#[derive(Debug)]
+pub struct ParamItem(&'static [u8]);
+
+impl Deref for ParamItem {
+ type Target = [u8];
+ fn deref(&self) -> &Self::Target {
+ return self.0;
+ }
+}
+
+impl ParamItem {
+ pub fn new(raw: &'static [u8]) -> Self {
+ ParamItem(raw)
+ }
+}
+
+pub type Param = <Vec<ParamItem> as IntoIterator>::IntoIter; \ No newline at end of file