unsafe-rust advance-trait trait-ref-type 与trait相关的关联类型 default type param 默认参数类型 fully qualified syntax 完全限定语法 supertraits 超父类 newtype模式 advance-type more about new-type pattern type alias 类型别名 never type dymatic-size type 动态大小类型 advance function and closure function point 函数指针 return closure 返回闭包 macro 宏 unsafe-rust the-addional-super power of unsafe
解引用裸指针 调用不安全的函数或方法 访问或修改可变静态变量 实现不安全的trait 访问union字段 the owner-check is still on
unref-raw-point ignore owner-rule, allow mut and immute ref.
包括的内容:
字面量 literal 解构数组,枚举,结构提,元组等 变量 通配符 占位符 rust match rust match is exhaustive, all situation must be consided
_ match all, and not bind to variable, use to ignore
if let use can only care abouot one situation
fn main() { let favorite_color: Option<&str> = None; let is_tuesday = false; let age: Result<u8, _> = "34".parse(); if let Some(color) = favorite_color { println!("Using your favorite color, {}, as the backgourd", favorite_color); }else if is_tuesday { println!