how to create a function that accepts multiple types of structs.
i have mod1.rs and main.rs.
function in mod.rs can be called by multiple places so I can't hardcode struct in mod.rs.
i want to pass struct while calling like
mod mod1;
strcut Person {
name: String,
}fn main(){
let person_1 = Person{name: String::from("manny"};
mod1::run(p: person_1);
}
what should be fn run()
definition in mod1.rs
so that type is not hardcoded and accepts multips type structs.