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

  • 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.

主站蜘蛛池模板: 莱芜市| 石楼县| 长葛市| 华宁县| 海丰县| 临夏县| 德钦县| 桃江县| 沛县| 祁东县| 建平县| 平顺县| 安宁市| 社会| 辰溪县| 固安县| 新巴尔虎左旗| 襄垣县| 贡觉县| 洮南市| 澜沧| 木里| 弥渡县| 岗巴县| 比如县| 兰考县| 陆丰市| 平和县| 灵石县| 凤庆县| 金塔县| 东乌珠穆沁旗| 南丹县| 陵水| 区。| 萝北县| 宁阳县| 天津市| 方山县| 札达县| 新平|