知识卡片
Option区分值与缺席
Option<T> 的 Some(v) 包一个 T,None 表示没有该类型的值。分形函数返回 Some(i) 表示已在第 i 次检查观测到逃逸,None 表示预算内尚未看到。这使 0 等有效数值无需充当哨兵,也提醒接收方按具体接口解释缺席。
关联阅读:[[逃逸时间近似分形]]。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- A Tour of Rust 用迭代预算近似分形边界 · 查看原书依据
Option is an enumerated type, often called an enum, because its definition enumerates several variants that a value of this type could be:
参考来源
- 位置:《Programming Rust Fast, Safe Systems Development, 3rd ed. (First Early Release)》第01章《A Tour of Rust》|用迭代预算近似分形边界,来源项目 `book-source`,`extracted/Programming Rust Fast, Safe Systems Development, 3rd ed. (First Early Release)/_epub-src/OEBPS/ch01.xhtml#what-the-mandelbrot-set-actually-is`
- 结论依据:原文定义 Some 和 None,再给出逃逸时间的具体语义。
- 原始内容:Option is an enumerated type, often called an enum, because its definition enumerates several variants that a value of this type could be: