struct
struct MyStruct;
impl MyStruct{
pub fn new() -> MyStruct{
MyStruct //return a new instance of MyStruct
}
}
fn main() {
let instance = MyStruct::new();
}INFO
struct MyStruct;
impl MyStruct{
pub fn new() -> MyStruct{
MyStruct //return a new instance of MyStruct
}
}
fn main() {
let instance = MyStruct::new();
}