舉報(bào)

會(huì)員
Rust Quick Start Guide
Rustisanemergingprogramminglanguageapplicabletoareassuchasembeddedprogramming,networkprogramming,systemprogramming,andwebdevelopment.ThisbookwilltakeyoufromthebasicsofRusttoapointwhereyourcodecompilesanddoeswhatyouintendittodo!ThisbookstartswithanintroductiontoRustandhowtogetsetforprogramming,includingtherustupandcargotoolsformanagingaRustinstallationanddevelopmentworkflow.Thenyou'lllearnaboutthefundamentalsofstructuringaRustprogram,suchasfunctions,mutability,datastructures,implementingbehaviorfortypes,andmanymore.YouwillalsolearnaboutconceptsthatRusthandlesdifferentlyfrommostotherlanguages.AfterunderstandingtheBasicsofRustprogramming,youwilllearnaboutthecoreideas,suchasvariableownership,scope,lifetime,andborrowing.Afterthesekeyideas,youwillexploremakingdecisionsinRustbasedondatatypesbylearningaboutmatchandifletexpressions.Afterthat,you'llworkwithdifferentdatatypesinRust,andlearnaboutmemorymanagementandsmartpointers.
目錄(177章)
倒序
- coverpage
- Title Page
- About Packt
- Why subscribe?
- Packt.com
- Contributors
- About the author
- About the reviewers
- Packt is searching for authors like you
- Preface
- Who this book is for
- What this book covers
- To get the most out of this book
- Download the example code files
- Download the color images
- Conventions used
- Get in touch
- Reviews
- Getting Ready
- Installing Rust
- Starting a new project
- Project metadata
- Dependencies on libraries from crates.io
- Dependencies on Git repositories
- Dependencies on local libraries
- Automatically generated source files
- Compiling our project
- Debug and release builds
- Dynamic libraries software distribution and Rust
- Using crates.io
- Summary
- Basics of the Rust Language
- Functions
- Defining a function
- Modules
- Defining a module
- A module as a section of a file
- A module as a separate file
- Accessing module contents from outside
- Using the item's full name directly
- Using the item's short name
- Public and private module items
- Expressions
- Literal expressions
- Operator expressions
- Array and tuple expressions
- Block expressions
- Branch expressions
- Loop expressions
- while loops
- for loops
- Variables types and mutability
- Type inference
- Data structures
- Mutability of data structures
- More about functions
- Parameters
- Return types
- Error handling
- Using Result to signal success or failure
- Calling functions that return Result
- Implementing behavior for types
- Summary
- The Big Ideas – Ownership and Borrowing
- Scope and ownership
- The stack
- Transferring ownership
- Copying
- Lending
- Lending immutably
- Lending mutably
- Accessing borrowed data
- The lifetime of borrowed data
- Ownership and the self parameter
- Moving self
- Borrowing self
- Mutably borrowing self
- Summary
- Making Decisions by Pattern Matching
- Variable assignment with pattern matching
- Using if let expressions to test whether a pattern matches
- Using match to choose one of several patterns
- Using don't care in patterns
- Moving and borrowing in pattern matches
- Matching tuples and other more complex patterns
- Nested patterns
- Storing a matched value and comparing it to a pattern
- Ignoring most of a data structure
- Gotchas
- Not all values can be matched against a literal pattern
- Patterns assign values to variable names
- Summary
- One Data Type Representing Multiple Kinds of Data
- Enumerations
- Basic enumerations
- Parameterized enumerations
- Checking the value type and extracting parameter values
- Result is an enumeration accessed via the prelude
- Traits and trait objects
- Traits
- Implementing our PrintableDirection trait
- Trait objects
- Using our PrintableDirection trait
- Trait objects only provide access to the trait interface
- Any
- Any can store almost anything
- But to access it we have to already know about the real data type
- Comparison of these techniques
- Summary
- Heap Memory and Smart Pointers
- Box
- Box and variable size
- Box and Any
- Vec and String
- String
- Vec
- Rc
- Weak references
- Cell and RefCell
- Cell
- What's the point?
- RefCell
- Arc
- Mutex and RwLock
- Summary
- Generic Types
- Types with generic type parameters
- Limiting what types can be used for type parameters
- Implementing functionality for types with generic type parameters
- Using generic types as function return values
- Compiler errors involving generic type parameters
- Generic types on functions outside of implementation blocks
- Alternative ways to write trait bounds
- Generic types versus trait objects
- Higher-order functions and trait bounds that represent functions
- Complete implementation of a binary tree with generic type parameters
- Summary
- Important Standard Traits
- Traits that can be derived
- Clone
- Copy
- Debug
- PartialEq
- Eq
- PartialOrd
- Ord
- Hash
- Default
- Traits that enable operators
- Add Mul Sub and Div
- AddAssign MulAssign SubAssign and DivAssign
- BitAnd
- BitAndAssign
- BitOr
- BitOrAssign
- BitXor
- BitXorAssign
- Deref
- DerefMut
- Drop
- Index
- IndexMut
- Neg
- Not
- Rem and RemAssign
- Shl and ShlAssign
- Shr and ShrAssign
- Traits that are implemented automatically
- Sync
- Send
- Sized
- Fn
- FnMut
- FnOnce
- Summary
- Other Books You May Enjoy
- Leave a review - let other readers know what you think 更新時(shí)間:2021-06-10 19:46:28
推薦閱讀
- iOS 9 Game Development Essentials
- Building Serverless Applications with Python
- Java:High-Performance Apps with Java 9
- 0 bug:C/C++商用工程之道
- 現(xiàn)代C++編程實(shí)戰(zhàn):132個(gè)核心技巧示例(原書第2版)
- Learning YARN
- Swift語言實(shí)戰(zhàn)晉級(jí)
- C編程技巧:117個(gè)問題解決方案示例
- 零基礎(chǔ)學(xué)HTML+CSS第2版
- Learning Python Data Visualization
- Visual Basic 程序設(shè)計(jì)實(shí)踐教程
- 精通Spring:Java Web開發(fā)與Spring Boot高級(jí)功能
- Python 快速入門(第3版)
- Using Yocto Project with BeagleBone Black
- VMware vSphere 5.5 Cookbook
- JavaScript語法簡(jiǎn)明手冊(cè)
- 第五空間戰(zhàn)略:大國(guó)間的網(wǎng)絡(luò)博弈
- Learning SaltStack(Second Edition)
- 區(qū)塊鏈原理與技術(shù)應(yīng)用
- CorelDRAW X6中文版應(yīng)用教程(第二版)
- IPython Notebook Essentials
- 大數(shù)據(jù)可視化編程和應(yīng)用
- OpenCL Programming by Example
- 視界·無界2.0:寫給UI設(shè)計(jì)師的設(shè)計(jì)書(全彩)
- R語言與數(shù)據(jù)可視化
- Python數(shù)據(jù)分析案例實(shí)戰(zhàn)(慕課版)
- 計(jì)算機(jī)組裝與維護(hù)(第二版)
- Scratch趣味創(chuàng)意編程
- Hands-On Deep Learning with TensorFlow
- 從零開始:PHP網(wǎng)頁開發(fā)基礎(chǔ)