skip to content
Learning Rust. Preview this item
ClosePreview this item
Checking...

Learning Rust.

Author: Paul Johnson; Vesa Kaihlavirta
Publisher: Birmingham : Packt Publishing, 2016.
Edition/Format:   eBook : Document : EnglishView all editions and formats
Summary:
Chapter 13: The Standard Library -- Chapter format -- What is the standard library? -- The standard modules (overview) -- Primitive types (overview) -- Macros (overview) -- Prelude -- The standard modules -- std::Any -- std::ascii -- std::borrow -- std::boxed -- std::cell -- std::char -- std::clone -- std::cmp -- std::collections -- std::convert -- std::default -- std:env -- std:error -- std::f32 -- std::f64 --  Read more...
Rating:

(not yet rated) 0 with reviews - Be the first.

Subjects
More like this

Find a copy online

Links to this item

Find a copy in the library

&AllPage.SpinnerRetrieving; Finding libraries that hold this item...

Details

Genre/Form: Electronic books
Additional Physical Format: Print version:
Johnson, Paul.
Learning Rust.
Birmingham : Packt Publishing, ©2016
Material Type: Document, Internet resource
Document Type: Internet Resource, Computer File
All Authors / Contributors: Paul Johnson; Vesa Kaihlavirta
ISBN: 9781785888885 1785888889
OCLC Number: 1013822730
Description: 1 online resource (300 pages)
Contents: Cover --
Title Page --
Copyright --
Credits --
About the Authors --
About the Reviewer --
www.PacktPub.com --
Customer Feedback --
Table of Contents --
Preface --
Chapter 1: Introducing and Installing Rust --
Installing Rust --
Installing rustup on Linux --
gcc prerequisites --
Testing your installation --
Integrated Development Environment --
Your first Rust project --
Structure of a Rust project --
Automating things --
Creating a binary package using Cargo --
Using Cargo to build and run an application --
Cleaning your source tree with Cargo --
Creating documentation using Cargo --
rustdoc versus Cargo --
Using Cargo to help with your unit testing --
Assert yourself! --
Is there anything Cargo can't do? --
Summary --
Chapter 2: Variables --
Variable mutability --
Creating a variable --
How can we tell the compiler that we want x to be an int? --
Defining other variable types --
Float --
Signed and unsigned integers --
Const and static --
Defining the variable value before use --
Strings --
How Rust uses memory --
Back to Strings --
String slices --
What's with the warnings? --
Using the format! macro --
Building a string --
Code review --
Casting --
String methods --
Generics and arrays --
Arrays --
Array performance --
Vectors --
Creating a vector with an initial size --
Creating a vector via an iterator --
Adding and removing from the vector --
Manipulating an array or vector via slices --
Passing values around --
Passing by value --
Passing by reference --
The reference type --
A practical example --
Summary --
Chapter 3: Input and Output --
Functions and methods in Rust --
The difference between println! and println --
Introduction to the standard library --
The libraries --
Controlling the output formatting --
Positioning the output --
Named parameters --
Specifying the argument types --
Formatting traits --
Formatting parameters. Getting information in --
Command-line arguments --
Handling files --
Reading from a file --
Loading a file --
Writing a file --
The use of expect --
XML and Rust --
Reading a file --
Writing a file --
Summary --
Chapter 4: Conditions, Recursion, and Loops --
Loops --
The for loop --
Using enumerate --
The _ parameter --
The simple loop --
The while condition --
Prematurely terminating a loop --
Using loop labels --
Recursive functions --
What is the difference between having and not having a semicolon? --
Summary --
Chapter 5: Remember, Remember --
Let's start at the beginning --
The stack frame --
What is meant by the stack? --
Let's consider the heap --
Deallocation --
What about functions with arguments? --
Static memory allocation --
Garbage collecting time and ownership --
An owned pointer example --
Comparison to C --
Let's revisit some old code --
Let's not race ahead! --
Stop the race... --
Summary --
Chapter 6: Creating Your Own Rust Applications --
Project 1 --
let's start with some math --
Requirements --
Supplied data --
Application output --
Project 2 --
some text manipulation --
Requirements --
Code notes --
Project 3 --
area and volume --
Shape types --
Volume or area --
User-defined shape --
Formulae for calculations --
Testing criteria --
Auto-documentation --
Using regular expressions (regex) --
Input and output --
Project 4 --
memory --
Bitwise rotation --
Rotation caveat --
Output --
Summary --
Chapter 7: Matching and Structures --
Structs 101 --
Variables, variables everywhere --
The structure of a struct --
Smaller is better --
Accessing a struct --
Defining the child structures --
Multi-file version --
Private versus public fields --
Structs 102 --
Tuples --
Using a tuple to define a variable --
Tuple indexing --
Destructuring with let --
Tuple structs --
the hybrid of two --
The single element tuple struct. Back to the unit-like struct --
Enumerations --
Accessing enumeration members --
The two questions you should be asking --
Patterns and matching --
Matching --
Let's really make the function simple --
Using match with an enum --
Ignoring a parameter with match --
Fall through patterns --
Ranges --
Creating a binding within a match pattern --
Let's add an if into the mix --
Using match with a compound type --
And back to if let --
Summary --
Chapter 8: The Rust Application Lifetime --
What are they? --
Ownership --
Borrowing --
Lifetime --
Ownership in Rust --
Abstractions --
Ownership --
from the beginning --
Variable binding --
Stack and heap variables --
Why is this important? --
The Copy trait --
Borrowing in Rust --
Borrow immutability --
Mutable borrows --
The Rust borrowing rules --
Fixing the problem --
Think about the scope --
It's all for your own good --
The lifetime --
The mythical bank account --
The lifetime variable --
' --
Lifetime of other types --
Lifetime within an struct --
Multiple lifetimes --
Always consider the scope --
'struct --
Input and output lifetimes --
Input only --
Output only --
Input and output --
Summary --
Chapter 9: Introducing Generics, Impl, and Traits --
Generics 101 --
Understanding the error --
A generic problem --
The unsafe directive --
The whole #! --
Traits and Impl --
Impl --
The impl lifetime --
And back to traits we go... --
A simple crate example --
Traits and generics --
Defining the impl for specific types --
Using where --
Making it work --
Something you may have noticed --
Generics --
a small aside --
So what does happen? --
Back to the where version --
Try to compile --
Trait bounds --
Can we reduce the amount of code further? --
Can the default method be overridden? --
Rounding off traits --
Inheritance --
Deriving --
Trait objects --
Let's create a sample test setup --
Let's see dynamic dispatch. Keeping your object safe --
Summary --
Chapter 10: Creating Your Own Crate --
What exactly is a crate? --
Looking at modules --
I can see a problem with this analogy --
Back to our math library --
Using a useful name --
Let's create! --
Creating top-level modules --
The multifile module --
What about submodules? --
The mod.rs file --
Let's add some code --
Beware of double name scopes --
Adding unit tests to the library --
Making something public --
Let's give our crate a quick run out --
External dependencies --
Changing the scope --
Altering the crate name --
Optimizing your use statements --
The use-everything approach --
The you-decide approach --
The use-me approach --
The use-me-but-call-me-something-else approach --
The use-glob approach --
The use-glob-self approach --
Summary --
Chapter 11: Concurrency in Rust --
A bit of a story --
What was that all about? --
Send --
Sync --
When is an immutable variable not an immutable variable? --
And it's obviously mutable, it has mut in the definition --
Interior mutability --
Back to sync --
A beginner's guide to threading in Rust --
An easy approach to thinking about how threads work. --
Joining threads --
Closures --
Closures aren't all they first appear to be --
Closures as function arguments --
Closures with explicit lifetimes --
a special case --
Returning a closure --
What is the move parameter? --
Back to threading --
Ownership has its advantages --
The reference counter --
Problem solved --
use Mutex --
Why do we put the thread to sleep? --
Thread synchronization --
Thread panics --
Summary --
Chapter 12: Now It's Your Turn! --
Task 1 --
cleaning the code (part 1) --
The problems with each option --
The String option --
The struct option --
The task --
Task 2 --
cleaning the code (part 2) --
The task --
Task 3 --
extending the crate (part 1) --
The task --
Task 4 --
extending the crate (part 2).

Abstract:

Chapter 13: The Standard Library -- Chapter format -- What is the standard library? -- The standard modules (overview) -- Primitive types (overview) -- Macros (overview) -- Prelude -- The standard modules -- std::Any -- std::ascii -- std::borrow -- std::boxed -- std::cell -- std::char -- std::clone -- std::cmp -- std::collections -- std::convert -- std::default -- std:env -- std:error -- std::f32 -- std::f64 -- std:ffi -- std::fmt -- std::fs -- std::hash -- std::i8 -- std::i16 -- std::i32 -- std::i64 -- std::io -- std::isize -- std::iter -- std::marker -- std::mem -- std:net -- std::num -- std::os -- std::panic -- std::path -- std::process -- std::ptr -- std::slice -- std::str -- std::string -- std::sync -- std::thread -- std::time -- std::u8 -- std::u16 -- std::u32 -- std::u64 -- std::usize -- std::vec -- Summary -- Chapter 14: Foreign Function Interfaces -- Introducing our simple library -- The three-step program -- Including the dependency -- Creating the code -- What's the [link(name="")] for? -- What's the big deal? That was simple enough! -- Let's extend things a bit -- What happens if the types don't match? -- Can we make things safer? -- Wrappers -- A practical example -- Accessing global variables -- Cleaning up after yourself -- Drop it! -- Monitoring an external process within an FFI -- Targeting synchronous callbacks -- Targeting a Rust object -- Calling Rust from another language -- Dealing with the unknown -- C structs -- Summary -- Index.

Reviews

User-contributed reviews
Retrieving GoodReads reviews...
Retrieving DOGObooks reviews...

Tags

Be the first.

Similar Items

Confirm this request

You may have already requested this item. Please select Ok if you would like to proceed with this request anyway.

Linked Data


Primary Entity

<http://www.worldcat.org/oclc/1013822730> # Learning Rust.
    a schema:CreativeWork, schema:Book, schema:MediaObject ;
    library:oclcnum "1013822730" ;
    library:placeOfPublication <http://experiment.worldcat.org/entity/work/data/3005084079#Place/birmingham> ; # Birmingham
    library:placeOfPublication <http://id.loc.gov/vocabulary/countries/enk> ;
    schema:about <http://dewey.info/class/005.13/> ;
    schema:about <http://experiment.worldcat.org/entity/work/data/3005084079#Topic/object_oriented_programming_languages> ; # Object-oriented programming languages
    schema:bookFormat schema:EBook ;
    schema:contributor <http://experiment.worldcat.org/entity/work/data/3005084079#Person/kaihlavirta_vesa> ; # Vesa Kaihlavirta
    schema:creator <http://experiment.worldcat.org/entity/work/data/3005084079#Person/johnson_paul> ; # Paul Johnson
    schema:datePublished "2016" ;
    schema:description "Chapter 13: The Standard Library -- Chapter format -- What is the standard library? -- The standard modules (overview) -- Primitive types (overview) -- Macros (overview) -- Prelude -- The standard modules -- std::Any -- std::ascii -- std::borrow -- std::boxed -- std::cell -- std::char -- std::clone -- std::cmp -- std::collections -- std::convert -- std::default -- std:env -- std:error -- std::f32 -- std::f64 -- std:ffi -- std::fmt -- std::fs -- std::hash -- std::i8 -- std::i16 -- std::i32 -- std::i64 -- std::io -- std::isize -- std::iter -- std::marker -- std::mem -- std:net -- std::num -- std::os -- std::panic -- std::path -- std::process -- std::ptr -- std::slice -- std::str -- std::string -- std::sync -- std::thread -- std::time -- std::u8 -- std::u16 -- std::u32 -- std::u64 -- std::usize -- std::vec -- Summary -- Chapter 14: Foreign Function Interfaces -- Introducing our simple library -- The three-step program -- Including the dependency -- Creating the code -- What's the [link(name="")] for? -- What's the big deal? That was simple enough! -- Let's extend things a bit -- What happens if the types don't match? -- Can we make things safer? -- Wrappers -- A practical example -- Accessing global variables -- Cleaning up after yourself -- Drop it! -- Monitoring an external process within an FFI -- Targeting synchronous callbacks -- Targeting a Rust object -- Calling Rust from another language -- Dealing with the unknown -- C structs -- Summary -- Index."@en ;
    schema:description "Cover -- Title Page -- Copyright -- Credits -- About the Authors -- About the Reviewer -- www.PacktPub.com -- Customer Feedback -- Table of Contents -- Preface -- Chapter 1: Introducing and Installing Rust -- Installing Rust -- Installing rustup on Linux -- gcc prerequisites -- Testing your installation -- Integrated Development Environment -- Your first Rust project -- Structure of a Rust project -- Automating things -- Creating a binary package using Cargo -- Using Cargo to build and run an application -- Cleaning your source tree with Cargo -- Creating documentation using Cargo -- rustdoc versus Cargo -- Using Cargo to help with your unit testing -- Assert yourself! -- Is there anything Cargo can't do? -- Summary -- Chapter 2: Variables -- Variable mutability -- Creating a variable -- How can we tell the compiler that we want x to be an int? -- Defining other variable types -- Float -- Signed and unsigned integers -- Const and static -- Defining the variable value before use -- Strings -- How Rust uses memory -- Back to Strings -- String slices -- What's with the warnings? -- Using the format! macro -- Building a string -- Code review -- Casting -- String methods -- Generics and arrays -- Arrays -- Array performance -- Vectors -- Creating a vector with an initial size -- Creating a vector via an iterator -- Adding and removing from the vector -- Manipulating an array or vector via slices -- Passing values around -- Passing by value -- Passing by reference -- The reference type -- A practical example -- Summary -- Chapter 3: Input and Output -- Functions and methods in Rust -- The difference between println! and println -- Introduction to the standard library -- The libraries -- Controlling the output formatting -- Positioning the output -- Named parameters -- Specifying the argument types -- Formatting traits -- Formatting parameters."@en ;
    schema:exampleOfWork <http://worldcat.org/entity/work/id/3005084079> ;
    schema:genre "Electronic books"@en ;
    schema:inLanguage "en" ;
    schema:isSimilarTo <http://worldcat.org/entity/work/data/3005084079#CreativeWork/learning_rust> ;
    schema:name "Learning Rust."@en ;
    schema:productID "1013822730" ;
    schema:publication <http://www.worldcat.org/title/-/oclc/1013822730#PublicationEvent/birmingham_packt_publishing_2016> ;
    schema:publisher <http://experiment.worldcat.org/entity/work/data/3005084079#Agent/packt_publishing> ; # Packt Publishing
    schema:url <http://public.ebookcentral.proquest.com/choice/publicfullrecord.aspx?p=5163030> ;
    schema:url <http://public.eblib.com/choice/publicfullrecord.aspx?p=5163030> ;
    schema:url <https://ebookcentral.proquest.com/lib/liverpool/detail.action?docID=5163030> ;
    schema:workExample <http://worldcat.org/isbn/9781785888885> ;
    wdrs:describedby <http://www.worldcat.org/title/-/oclc/1013822730> ;
    .


Related Entities

<http://experiment.worldcat.org/entity/work/data/3005084079#Agent/packt_publishing> # Packt Publishing
    a bgn:Agent ;
    schema:name "Packt Publishing" ;
    .

<http://experiment.worldcat.org/entity/work/data/3005084079#Person/johnson_paul> # Paul Johnson
    a schema:Person ;
    schema:familyName "Johnson" ;
    schema:givenName "Paul" ;
    schema:name "Paul Johnson" ;
    .

<http://experiment.worldcat.org/entity/work/data/3005084079#Person/kaihlavirta_vesa> # Vesa Kaihlavirta
    a schema:Person ;
    schema:familyName "Kaihlavirta" ;
    schema:givenName "Vesa" ;
    schema:name "Vesa Kaihlavirta" ;
    .

<http://experiment.worldcat.org/entity/work/data/3005084079#Topic/object_oriented_programming_languages> # Object-oriented programming languages
    a schema:Intangible ;
    schema:name "Object-oriented programming languages"@en ;
    .

<http://worldcat.org/isbn/9781785888885>
    a schema:ProductModel ;
    schema:isbn "1785888889" ;
    schema:isbn "9781785888885" ;
    .


Content-negotiable representations

Close Window

Please sign in to WorldCat 

Don't have an account? You can easily create a free account.