Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
Applying Concurrency with Async In this section, we’ll apply async to some of the same concurrency challenges we tackled with threads in Chapter 16. Because we already talked about a lot of the key ideas there, in this section we’ll focus o...
doc.rust-lang.org The Rust Programming Language Book 2024-02-01 ~13 min read
Yielding Control to the Runtime Recall from the “Our First Async Program” section that at each await point, Rust gives a runtime a chance to pause the task and switch to another one if the future being awaited isn’t ready. The inverse is al...
doc.rust-lang.org The Rust Programming Language Book 2024-02-01 ~7 min read
Streams: Futures in Sequence Recall how we used the receiver for our async channel earlier in this chapter in the “Message Passing” section. The async recv method produces a sequence of items over time. This is an instance of a much more ge...
doc.rust-lang.org The Rust Programming Language Book 2024-02-01 ~3 min read
A Closer Look at the Traits for Async Throughout the chapter, we’ve used the Future, Stream, and StreamExt traits in various ways. So far, though, we’ve avoided getting too far into the details of how they work or how they fit together, whi...
doc.rust-lang.org The Rust Programming Language Book 2024-02-01 ~17 min read
Putting It All Together: Futures, Tasks, and Threads As we saw in Chapter 16, threads provide one approach to concurrency. We’ve seen another approach in this chapter: using async with futures and streams. If you’re wondering when to choose...
doc.rust-lang.org The Rust Programming Language Book 2024-02-01 ~4 min read
Object-Oriented Programming Features Object-oriented programming (OOP) is a way of modeling programs. Objects as a programmatic concept were introduced in the programming language Simula in the 1960s. Those objects influenced Alan Kay’s pro...
doc.rust-lang.org The Rust Programming Language Book 2024-02-01 ~1 min read
Characteristics of Object-Oriented Languages There is no consensus in the programming community about what features a language must have to be considered object oriented. Rust is influenced by many programming paradigms, including OOP; for...
doc.rust-lang.org The Rust Programming Language Book 2024-02-01 ~5 min read
Using Trait Objects to Abstract over Shared Behavior In Chapter 8, we mentioned that one limitation of vectors is that they can store elements of only one type. We created a workaround in Listing 8-9 where we defined a SpreadsheetCell enum...
doc.rust-lang.org The Rust Programming Language Book 2024-02-01 ~8 min read
Implementing an Object-Oriented Design Pattern The state pattern is an object-oriented design pattern. The crux of the pattern is that we define a set of states a value can have internally. The states are represented by a set of state objec...
doc.rust-lang.org The Rust Programming Language Book 2024-02-01 ~19 min read
Patterns and Matching Patterns are a special syntax in Rust for matching against the structure of types, both complex and simple. Using patterns in conjunction with match expressions and other constructs gives you more control over a progra...
doc.rust-lang.org The Rust Programming Language Book 2024-02-01 ~1 min read
All the Places Patterns Can Be Used Patterns pop up in a number of places in Rust, and you’ve been using them a lot without realizing it! This section discusses all the places where patterns are valid. match Arms As discussed in Chapter 6,...
doc.rust-lang.org The Rust Programming Language Book 2024-02-01 ~7 min read
Refutability: Whether a Pattern Might Fail to Match Patterns come in two forms: refutable and irrefutable. Patterns that will match for any possible value passed are irrefutable. An example would be x in the statement let x = 5; because x m...
doc.rust-lang.org The Rust Programming Language Book 2024-02-01 ~2 min read
Pattern Syntax In this section, we gather all the syntax that is valid in patterns and discuss why and when you might want to use each one. Matching Literals As you saw in Chapter 6, you can match patterns against literals directly. The fol...
doc.rust-lang.org The Rust Programming Language Book 2024-02-01 ~19 min read
Advanced Features By now, you’ve learned the most commonly used parts of the Rust programming language. Before we do one more project, in Chapter 21, we’ll look at a few aspects of the language you might run into every once in a while but m...
doc.rust-lang.org The Rust Programming Language Book 2024-02-01 ~1 min read
Unsafe Rust All the code we’ve discussed so far has had Rust’s memory safety guarantees enforced at compile time. However, Rust has a second language hidden inside it that doesn’t enforce these memory safety guarantees: It’s called unsafe R...
doc.rust-lang.org The Rust Programming Language Book 2024-02-01 ~20 min read
Advanced Traits We first covered traits in the “Defining Shared Behavior with Traits” section in Chapter 10, but we didn’t discuss the more advanced details. Now that you know more about Rust, we can get into the nitty-gritty. Defining Trai...
doc.rust-lang.org The Rust Programming Language Book 2024-02-01 ~13 min read
Advanced Types The Rust type system has some features that we’ve so far mentioned but haven’t yet discussed. We’ll start by discussing newtypes in general as we examine why they are useful as types. Then, we’ll move on to type aliases, a fe...
doc.rust-lang.org The Rust Programming Language Book 2024-02-01 ~9 min read
Advanced Functions and Closures This section explores some advanced features related to functions and closures, including function pointers and returning closures. Function Pointers We’ve talked about how to pass closures to functions; you...
doc.rust-lang.org The Rust Programming Language Book 2024-02-01 ~5 min read
Macros We’ve used macros like println! throughout this book, but we haven’t fully explored what a macro is and how it works. The term macro refers to a family of features in Rust—declarative macros with macro_rules! and three kinds of proce...
doc.rust-lang.org The Rust Programming Language Book 2024-02-01 ~17 min read
Final Project: Building a Multithreaded Web Server It’s been a long journey, but we’ve reached the end of the book. In this chapter, we’ll build one more project together to demonstrate some of the concepts we covered in the final chapters,...
doc.rust-lang.org The Rust Programming Language Book 2024-02-01 ~1 min read
"... opaque number sequences (\<GitHub\> "issue numbers") are not very informative about what is behind that pointer, and pretending they are is harmfu..."

Search tips

Type anything to search across articles, videos (including conference talks), podcasts, and research. These operators give you finer control — click an example to try it.

Find pages containing all your words. Pages where the words appear together rank higher.
Quote part of your query to keep those words together as an exact phrase within a larger search.
Wrap the whole query in quotes for a verbatim search that matches text exactly, punctuation and all — perfect for Rust syntax. Needs at least 3 characters.
Limit results to a single site. Works on its own () too. One site: per search.

Use the tabs and filters above the results to narrow by content type, publication year, and sort order.