Examples in "Rust Essentials" Book
Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety.
- Zero-cost abstractions
- move semantics
- guaranteed memory safety
- threads without data races
- trait-based generics
- pattern matching
- type inference
- minimal runtime
- efficient C bindings
Examples in "Rust Essentials" book are built by Rust 1.0.0.
Currently, however, Rust stable version is 1.9.0.
Some semantics are changed and added.
So, I tested all examples by Rust 1.9.0(stable) and 1.11.0(nightly).
-
Welcome
-
WelcomeC (use cargo)
-
Name
-
SmallestProgram
-
Alias
-
Bindings
-
Comments
-
Constants1
-
Constants2
-
Expressions
-
MutableConstant
-
References
-
Scope
-
TypeConversions
-
TypeErrors
-
Types2
-
ChangeConstant
-
CompoundLet
-
Formatting
-
AttributesCfg
-
AttributesTesting
-
ExDoc (use rustdoc)
-
Functions
-
IfElse
-
IterStep
-
Loops
-
MyLib (use cargo)
-
Random (use cargo)
-
Absolute
-
IfReturn
-
IfTest
-
Arrays
-
Enums
-
Input
-
PatternMatch
-
PatternMatch2
-
Strings
-
Structs
-
Tuples
-
CharsString
-
Monster
-
PatternMatch
-
TuplesEx
-
AdapterConsumers
-
Errors
-
Generics
-
HigherFunctions
-
Iterators
-
Methods
-
TraitConstraints (use cargo)
-
Traits
-
Complex
-
DrawTrait
-
Fold
-
RangeNext
-
Boxes1
-
Boxes2
-
Errors
-
Lifetimes
-
Ownership1
-
Ownership2
-
Ref
-
RefCount
-
RefCountNotGood
-
References
-
DanglingPointer
-
GrowTentacle
-
Ownership3
-
Cube (use cargo)
-
ImportModules
-
Macros
-
Modules
-
Monsters (use cargo)
-
Structs
-
MacroEx
-
PrivStruct
-
Channels
-
Channels2
-
MakeChannel
-
ManyThreads
-
ManyThreads2 (use cargo)
-
NotShared
-
PanicThread
-
SyncChannel
-
ThreadSafe
-
ThreadSpawn
- SharedChannel
-
Arguments
-
Asm (use nightly)
-
CallingCLibrary
-
CallingLibc (use nightly)
-
RawPointers
-
Unsafe
- Rust Stable Release (1.9.0)
- Rust Nightly Release (1.11.0)
- Microsoft Visual Studio 2015
- VisualRust
The class is licensed under the MIT License:
Copyright © 2016 Chris Ohk
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.