trait Summary {
fn new(name: &'static str, attributes: Attributes) -> Self;
}
#[derive(Debug)]
struct Environment {
editor : &'static str,
window_manager : &'static str',
operating_system : &'static str,
}
#[derive(Debug)]
struct Programming {
expert : [&'static str; 3],
intermediate : [&'static str; 6],
learning : [&'static str; 3],
}
#[derive(Debug)]
struct Attributes {
interest : [&'static str; 5],
natural_langauge : [&'static str; 2],
environment : Environment,
technical_language : Programming,
}
struct Person {
name : &'static str,
attributes : Attributes,
}
impl Summary for Person {
fn new(name: &'static str, attributes: Attributes) -> Person {
Person {
name,
attributes,
}
}
}
fn main() {
let environment = Environment {
editor : "vim",
window_manager : "dwm",
operating_system : "linux",
};
let programming = Programming {
expert : [ "python", "c#", "bash" ],
intermediate : [ "c", "c++", "vimscript", "lua", "haskell", "java" ],
learning : [ "rust", "wasm", "typescript" ],
};
let my_attributes = Attributes {
interest : [
"Distributed-Systems",
"Software-Architecture",
"Web3-stack",
"Algorithms",
"Backend-Engineering"
],
natural_langauge : [ "English", "Indigenous" ],
environment,
technical_language : programming,
};
let my_name = "zipyx";
let person: Person = Person::new(
my_name,
my_attributes,
);
}
zipyx Goto Github PK
Name: zipyx
Type: User