知识卡片

操作参考卡 · 6074.d.1.a.5.b · 生成模型:未记录

运算符按语境辨义

理解等级:中级

判读运算符要先分清它位于类型、表达式还是模式。以 & 为例,它可以构造借用、写在引用类型中,也可以在两个值之间执行按位与。若表中指定相应 trait,可追踪自定义类型的实现理解具体行为。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 附录 B · 运算符和符号 Operators · 查看原书依据

      Table B-1 contains the operators in Rust, an example of how the operator would appear in context, a short explanation, and whether that operator is overloadable. If an operator is overloadable, the relevant trait to use to overload that operator is listed.

    参考来源

    - 位置:《The Rust Programming Language(第2版)》附录 B · 运算符和符号(来源项目 a19c7933-4eda-4176-aebd-30fe7e1ad292,`extracted/The Rust Programming Language(第2版)/_epub-src/b02.xhtml`,块 0005) - 结论依据:附录为每个运算符列用法和可重载时的 trait。 - 原始内容:Table B-1 contains the operators in Rust, an example of how the operator would appear in context, a short explanation, and whether that operator is overloadable. If an operator is overloadable, the relevant trait to use to overload that operator is listed.