上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 33 下一页
摘要: pub trait Summary { fn summarize_author(&self) -> String; fn summarize(&self) -> String { format!("(Default Read more from {}...)", self.summarize_aut 阅读全文
posted @ 2020-05-15 18:07 Please Call me 小强 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 之前定义的结构体,都是不含引用的。 如果想定义含引用的结构体,请定义生命周期注解 #[warn(unused_variables)] struct ImportantExcerpt<'a> { part: &'a str, } fn main() { let novel = String::from 阅读全文
posted @ 2020-05-15 15:48 Please Call me 小强 阅读(365) 评论(0) 推荐(0) 编辑
摘要: 记录一下自己理解的生命周期。 每个变量都有自己的生命周期。 在c++里生命周期好比作用域, 小的作用域的可以使用大作用域的变量。 如果把这里的每个作用域取个名,那么就相当于rust里的生命周期注解。 拿例子说事一: 如果按照c++的方式来理解, 这个x和r的作用域是一样的,都是在main函数中。 但 阅读全文
posted @ 2020-05-15 14:09 Please Call me 小强 阅读(1220) 评论(0) 推荐(0) 编辑
摘要: fn main(){ for i in 1..10 { for j in 1..i+1 { print!("{}*{}={:<2} ",j,i,i*j); } print!("\n"); } } 阅读全文
posted @ 2020-05-14 13:13 Please Call me 小强 阅读(254) 评论(0) 推荐(0) 编辑
摘要: Available codegen options: -C ar=val -- this option is deprecated and does nothing -C linker=val -- system linker to link outputs with -C link-arg=val 阅读全文
posted @ 2020-05-14 10:25 Please Call me 小强 阅读(852) 评论(0) 推荐(0) 编辑
摘要: ➜ hello_cargo git:(master) ✗ rustc --print code-models Available code models: small kernel medium large 阅读全文
posted @ 2020-05-14 10:14 Please Call me 小强 阅读(183) 评论(0) 推荐(0) 编辑
摘要: Available CPUs for this target: native - Select the CPU of the current host (currently haswell). amdfam10 athlon athlon-4 athlon-fx athlon-mp athlon-t 阅读全文
posted @ 2020-05-14 10:13 Please Call me 小强 阅读(706) 评论(0) 推荐(0) 编辑
摘要: Rust中的每个值都具有特定的数据类型。 基础类型: 整数,浮点数,布尔值和字符 i8,i16,i32,i64,i64,i128,isize, u8,u16,u32,u64,u64,u128,usize, f64,f32 bool: true false char 复合类型:元组和数组 元组: le 阅读全文
posted @ 2020-05-12 15:06 Please Call me 小强 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 网站挂到阿里云上, 可以http访问, 也可以https访问。 但是如果用https方式访问网站。发现接口报错。 因为接口只提供http方式。 在谷歌浏览器出现: Mixed Content: The page at '<URL>' was loaded over HTTPS, but reques 阅读全文
posted @ 2020-05-12 14:00 Please Call me 小强 阅读(962) 评论(0) 推荐(0) 编辑
摘要: ${workspaceFolder} the path of the workspace folder that contains the tasks.json file ${workspaceRootFolderName} the name of the folder opened in VS C 阅读全文
posted @ 2020-05-11 14:40 Please Call me 小强 阅读(572) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 33 下一页