摘要: 创建对象 rust语言中struct没O有构造器。所以一般使用关联函数new创建一个对象 pub struct User { id: u32, pub username: String, pub role: Role, } impl User { pub fn new(username: Strin 阅读全文
posted @ 2022-04-07 15:37 杨琼 阅读(95) 评论(0) 推荐(0) 编辑