官术网_书友最值得收藏!

  • Rust Quick Start Guide
  • Daniel Arbuckle
  • 150字
  • 2021-06-10 19:46:04

Literal expressions

The simplest of Rust's expressions are the ones where we just write out the representation of the value we want. For example, when Rust sees 2 it knows we are asking it for the number 2. Similarly, when Rust sees "Hello, world!" it knows we're asking it to produce the sequence of letters that spells out Hello, world!

Rust recognizes the following literal expressions:

  • Numbers
  • Quoted text
  • Byte sequences
  • Single Unicode points
  • Single bytes
  • Boolean values

Numbers can be written as integers or decimal numbers or in engineering notation, and there are a few variants for quoted text and byte sequences, too. Boolean values are written as either true or false. In this book, we're not going to need any of the variants of quoted text, and we won't need byte sequences at all, so we won't go into those in more detail. See https://doc.rust-lang.org/ if you're curious.

主站蜘蛛池模板: 郓城县| 宁远县| 天门市| 前郭尔| 定兴县| 贵定县| 鄄城县| 河池市| 海丰县| 波密县| 宁海县| 西充县| 渭南市| 南宁市| 崇仁县| 县级市| 安丘市| 闵行区| 伊金霍洛旗| 福建省| 聂拉木县| 长乐市| 定西市| 张家港市| 南岸区| 剑川县| 栾川县| 疏附县| 商丘市| 射阳县| 酉阳| 普陀区| 黄平县| 河源市| 遵义市| 阿鲁科尔沁旗| 宝山区| 盐亭县| 新蔡县| 汉寿县| 利辛县|