Structs in CLIPS
new_person
constructs a new person struct with the given name.
Rust ensures memory safety through its ownership system, so you can safely return a struct from a function.
You can create a new struct instance using this syntax.
To run the program, put the code in main.rs
and use cargo run
.
Now that we can run and build basic Rust programs, let’s learn more about the language.