jona / jarvis.sh

public
Init Jarvis.sh in Rust
JJonathan committed on 2026-08-23 16:53 commit d709cb5
.gitignore +1 −0
+/target
Cargo.lock +7 −0
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 4
+
+[[package]]
+name = "jarvis"
+version = "0.1.0"
Cargo.toml +6 −0
+[package]
+name = "jarvis"
+version = "0.1.0"
+edition = "2024"
+
+[dependencies]
src/main.rs +74 −0
+#![allow(dead_code)]
+
+#[derive(Debug)]
+enum ParameterType {
+ Operational,
+ UI,
+ Tool
+}
+
+#[derive(Debug)]
+struct PluginConfig {
+ name: String
+}
+
+#[derive(Debug)]
+enum Value {
+ Instruction(String),
+ Asset(String),
+ Plugin(PluginConfig)
+}
+
+#[derive(Debug)]
+struct Parameter {
+ key: String,
+ category: ParameterType,
+ value: Value
+}
+
+struct Jarvis {
+ name: String,
+ cpu_usage: i32,
+ config: Vec<Parameter>
+}
+
+impl Jarvis {
+ fn create() -> Jarvis {
+ let new_instance = Jarvis {
+ name: "Jarvis coding assistant".to_string(),
+ cpu_usage: 125,
+ config: vec![]
+ };
+
+ new_instance
+ }
+
+ fn default_config(&mut self) {
+ let tone_value = Value::Asset("Positive".to_string());
+ let tone = Parameter {
+ key: "Tone".to_string(),
+ category: ParameterType::UI,
+ value: tone_value
+ };
+
+ self.config.push(tone);
+ }
+
+ fn operate(&self) {
+ println!("Hello Sr. Stark");
+ println!("Stats: ");
+ println!("\tname: {}", self.name);
+ println!("\tcpu usage: {}", self.cpu_usage);
+ println!("\tconfig: {:?}", self.config);
+ println!("How can I help you?");
+ print!("=>> ");
+ println!("Exiting....");
+ }
+}
+
+fn main() {
+ let mut jarvis = Jarvis::create();
+
+ jarvis.default_config();
+ jarvis.operate();
+}