c语言 sprintf_s 参数 通配符,Rust教程(翻译).doc

Rust教程(翻译)

The Rust Language Tutorial

目录

1.Introduction(介绍)

2.Getting started(开始)

3.Syntax basics(基础语法)

4.Control structures(控制结构)

5.Data structures(数据结构)

6.Functions(函数)

7.Destructors(析构函数)

8.Ownership(所有权)

9.Boxes(盒子)

10.Move semantics(所有权转移语义)

11.Borrowed pointers(借贷指针)

12.Dereferencing pointers(解引用指针)

13.Vectors and strings(容器和字符串)

14.Closures(闭包)

15.Methods(方法)

16.Generics(泛型)

17.Modules and crates(模块和箱子)

18.What next?(下一步?)

1.Introduction

Rust is a programming language with a focus on type safety, memory safety, concurrency and performance.(Rust是一个关注类型安全、内存安全、并发和性能的编程语言) It is intended for writing large-scale, high-performance software that is free from several classes of common errors.(它的目标是让大规模、高性能软件的编写免于几类常见错误。) Rust has a sophisticated memory model that encourages efficient data structures and safe concurrency patterns, forbidding invalid memory accesses that would otherwise cause segmentation faults. (Rust拥有精良的内存模型,鼓励高效数据结构和安全并发模式的使用,禁止对无效内存的访问,否则会造成段错误。)It is statically typed and compiled ahead of time.(它是需要预先编译的静态类型语言。)

As a multi-paradigm language, Rust supports writing code in procedural, functional and object-oriented styles. Some of its pleasant high-level features include:(Rust是一个多范式语言,支持面向过程、函数式和面向对象多种风格的代码。包含的高级特性如下:)

Type inference. Type annotations on local variable declarations are optional.(类型推导:申明局部变量时,类型注释是可选的。)

Safe task-based concurrency. Rust's lightweight tasks do not share memory, instead communicating through messages.(安全的基于任务的并发:Rust的轻量级任务通过消息进行通信而不共享内存。)

Higher-order functions. Efficient and flexible closures provide iteration and other control structures(高阶函数:高效和灵活的闭包,以提供迭代和其他控制结构使用。)

Pattern matching and algebraic data types. Pattern matching on Rust's enumeration types (a more powerful version of C's enums, similar to algebraic data types in functional languages) is a compact and expressive way to encode program logic.(模式匹配和代数数据类型:在Rust的枚举数据类型(一个比C的枚举类型更强大的版本,类似于函数式编程里的代数数据类型)上使用模式匹配是一种紧凑而更具表达性的程序逻辑表达方式。)

Polymorphism. Rust

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值