index
Symbols
_ wildcard 465
? operator 118, 407, 474
.. two dots 55
* (asterisk) 469
&str type 30 – 32, 128, 149 – 151, 189, 342, 434
#![no_std] attribute 269
#[cfg] attribute 269
#[deprecated] attribute 269
#[derive(Error)] attribute 360
#[derive] attribute 423
#[error] attribute 360
#[non_exhaustive] attribute 269, 449
+ operator 129
A
Add trait 129, 421
and other similar traits 420 – 423
Add variant 299
AddAssign trait 422
adds_hungary function 41 – 42
.all() method 177, 234
allocating memory, const and static 33
.and_hms_opt() method 350
.and_then() method 175
.and() method 175 – 176
angle brackets 91
annotations. See lifetime annotations
anonymous functions 161 – 168
closures
|_| in 167
inside of methods 163 – 164
lazy and fast 164 – 167
anonymous lifetime 195 – 199
ansi_term crate 486
Any trait 444
.any() method 177, 295
anyhow crate 357 – 360, 490
anyhow! macro 358
App struct 485, 490
App trait 513
.append() method 390
Arc (atomic reference counter) 233, 249 – 250, 252, 260
architecture 9
Args struct 382
args() method 383
argue_in_court() function 141
arguments 16, 466
closures as 234 – 244
example 242 – 244
relationship between FnOnce, FnMut, and Fn 239
simple closures 237 – 239
uniqueness of closures 240
arrays 53 – 55, 413 – 417
destructuring and mapping 414
implementing Iterator 413
using from_fn to make 415 – 417
.as_bytes() method 13
.as_micros() method 357
.as_nanos() method 357
ASCII 9, 47
AsRef trait 149 – 151
assert_eq! macro 123, 156, 289 – 290
assert_eq!() macro 416
assert_ne! macro 123
assert! macro 123, 290
Assign trait 422
associated items and associated constants 424 – 428
associated consts 427
associated functions 81, 425
associated types 158, 425
async block 406
async main 405
async Rust 402 – 410
basics of 402
checking whether Future is ready 403
feature flags 399 – 402
other details about 407 – 410
using async runtime 405 – 407
async_trait crate 410
AsyncIterator trait 410
atomic types 249
AtomicI64 type 249
AtomicU64 type 249
attributes 81, 129, 265 – 271, 289, 360, 423, 449
available_parallelism() method 355
.await keyword 403, 405 – 406
axum_sessions crate 512
B
b prefix 54
Backtrace struct 449
Backtrace::capture() function 447
backtraces 447 – 450
BacktraceStatus enum 449
.bark() method 131
basics
floats 15
printing 22
BigBuffers struct 325
BinaryHeap 115
blanket trait implementations 33, 134, 341, 362 – 366
Block widget 493, 499
blocking Client (reqwest crate) 399
BookCollection struct 158 – 159
bool 390, 428
bounds, traits as 140 – 142
Box 261, 271 – 281
basics of 271 – 273
downcasting to concrete type 279 – 281
handling multiple error types 276 – 279
putting around traits 273 – 276
Box<dyn Error> 490
BTreeMap 107 – 108
BTreeSet 113
Buffers struct 325
builder pattern 303, 307 – 314
adding final check to 309
builder methods 307
Deref 314 – 322
basics 314
implementing 316
using wrong way 320 – 322
DerefMut 318
final check to 309
making more rigorous 313
writing builder methods 307
.by_ref() method 182
byte array 54
C
.capacity() method 57
Cargo 374 – 380
compiling with 376 – 380
reasons for using 374 – 376
cargo add command 380
cargo add reqwest command 399
cargo build --release 445
cargo build --timings command 380
cargo clean command 380
cargo clippy command 380
cargo doc 392 – 394
cargo new command 375
cargo run --release 445
Cargo.toml file and external crates 336
casting enums into integers 78
.ceil() method 423
Cell 200
cfg attribute 269
cfg! macro 458 – 460
chaining methods 153
.change_city_data() method 242, 244
channel() function 256
channels 256 – 260
basics 256
implementing 257 – 260
char type 9, 417
characters 7 – 14
.chars() method 13, 295
.chars().count() method 13
check_book_type() function 213
check_guess() function 507
checked operations 419
.checked_ methods 420
.checked_add() method 419 – 420
.checked_div() method 419
.checked_mul() method 419
.checked_sub() method 317, 419
chrono crate 344 – 354, 495
checking code inside external crates 350
.chunks() method 183
City struct 84
ClearType enum 484
CLIs (command-line interfaces) 481
Clone trait 44, 92, 128
.clone() method 265
.cloned() method 182
cloning on write 215 – 219
closures 170 – 185, 233
|_| in 167
as arguments 234 – 244
example 242 – 244
relationship between FnOnce, FnMut, and Fn 239
simple closures 237 – 239
uniqueness of closures 240
checking 177 – 180
filtering 170 – 173
finding items inside 177 – 180
inside iterators 161 – 168
inside of methods 161 – 168
lazy and fast 164 – 167
mapping 170 – 173
methods 174 – 185
related methods 174 – 185
code
keeping clean with macros 475 – 479
code blocks 17
declaring variables 20
.collect() method 153, 156, 164, 414
collection types 53 – 60, 106 – 117
arrays 53 – 55
BinaryHeap 115
HashMap 107 – 108
.entry() method 110 – 113
HashSet 113
tuples 58 – 60
VecDeque 117
vectors 55 – 58
Color 32 522
column! macro 454
command-line arguments 382 – 385
command-line interfaces (CLIs) 481
comments 6 – 7
Company struct 170, 172
compare_and_display() function 94
complex examples 135 – 140
concrete &self 136
concurrency 251
const 33, 323 – 326
const functions 326 – 328, 366
mutable statics 328
const functions 326 – 328, 366
const generics 145, 324 – 326
const keyword 325
const values 324
ConstParam 324
control flow 60 – 70
basic 60
loops 66 – 70
match statements 61 – 65
copy semantics 42
Copy trait 92, 128, 135
Copy types 28, 42 – 45, 51, 438
.count() method 13
Country struct 73, 421
Cow type 209, 215 – 219, 342
crates 283 – 289, 341
error handling 357 – 362
Anyhow 358 – 359
thiserror 360 – 362
external 335 – 339
and Cargo.toml 336
rolling dice with rand crate 337 – 339
using rand crate 336
module 286
Rayon 354 – 357
reqwest crate 397 – 399
time crate 344 – 349
.create_new() method 390
.create() method 390
CreationContext 513
Crossterm 481, 487
CString type 412, 434
curly brackets 253
.cycle() method 180
cycling 180 – 185
D
DateTime struct 495
dbg! macro 169, 472 – 473
Debug mode 377 – 378
Debug printing 22
Debug trait 92, 128, 132, 138, 363
.debug_struct() method 278
.dedup() method 430
Default trait 303
Deref 149, 190, 302 – 303, 314 – 322
basics 314
implementing 316
using wrong way 320 – 322
DerefMut 318
implementing 304 – 306
.delete_book() function 212 – 213
deprecated attribute 270
dereferencing 36, 87
Deserialize attribute 342 – 343
Deserialize trait 489
.desired_width() method 524
destructuring 60, 83 – 87
destructuring arrays 414
directory and file navigator 520 – 527
developing code 522 – 524
further development and cleanup 524 – 526
setup and first code 521
DirectoryContent enum 527
DirEntry 521
Display printing 22
Display trait 92, 94, 132 – 135, 325, 478
.display_self() method 138 – 139
Div trait 422
DivAssign trait 422
diverging code 103
.do_operation() method 300
doc comments (documentation comments) 7
documentation
cargo doc 392 – 394
reading 262 – 271
[src] button 264
assert_eq! 262
attributes 265 – 271
searching 264
traits 265
dot operator 87
.downcast_mut() method 279
.downcast_ref() method 279, 281, 444
.downcast() method 279
downcasting 279
.drain() method 431
.draw() method 493
drop() function 206, 273, 431, 437 – 438
.duration_since() method 348
dyn keyword 275
dynamic dispatch 275
dynamically sized types 31, 216
E
eframe crate 513
eframe::run_native() method 513
egui crate 512
egui web demo 520
.elapsed() method 346, 355
Email type 319
Entry enum 111
.entry() method 110 – 113
.enumerate() method 164, 167
enums 72 – 83
casting into integers 78
implementing 81 – 83
using multiple types 79
env_logger crate 387
environment variables 385 – 387
error attribute 360
error handling 106, 357 – 362
Anyhow 358 – 359
panic hooks 442 – 447
panic! macro 122 – 126
thiserror 360 – 362
Error trait 444
ErrorKind enum 358
escape characters 46
.escape_unicode() method 417
Event enum 482, 501
exclusive range 55
execute! macro 484
ExitStatus 404
Expand button 470
.expect() method 124 – 125, 289
extern crate 451
external crates 323, 335 – 339
and Cargo.toml 336
rolling dice with rand crate 337 – 339
using rand crate 336
ExternalCrateError variant 363
extractors 505
F
f32 423
f64 423
fast closures 164 – 167
fastrand::bool() method 516
feature flags 399 – 402
ffi (foreign function interface) 434
File struct 314
File type 147 – 149
.file_name() method 521
.file_type() method 521
File::create() method 389
File::options() method 390, 392
file! macro 454, 473
files 388 – 392
creating 388
opening existing 389
OpenOptions 389 – 392
.filter_map() method 170
.filter() method 170, 434
filtering 170 – 173
.find() method 179
.flatten() method 176
floats 15, 423
.floor() method 423
.fmt() method 265, 276
fn pointers 327
Fn trait 239, 260
FnMut trait 239, 260
FnOnce trait 229, 231, 239, 260
.fold() method 180, 424
folding 180 – 185
for loop 154
.for_each() method 156, 163, 180
format_args! macro 471
format! macro 32, 360
.format() method 495
formating alignment 49
fragment specifiers 467
French trait 143
From trait 33, 128, 145 – 147, 417
from_fn() method 412, 415 – 417
from_str() method 343
from_utf8() method 101
from_ymd_opt() method 350
from_ymd() method 350
from() method 265
functions
importing and renaming inside 210
lifetimes in 191
functions.rs file 288
Future trait 398, 402
checking whether Future is ready 403
futures crate 410
futures_concurrency crate 410
G
generics 90 – 95, 233, 324
impl Trait 244 – 248
regular generics compared to 244 – 246
returning closures with 246 – 248
Option and Result 95 – 105
.get_article() method 490
.get_book() function 212 – 213
get_res_from_static() function 509
.get() method 102, 175, 265, 369, 397
give_eight() function 326
gives_higher() function 245
GivesOne struct 161
glob operator 286
GLOBAL_LOGGER 366, 370
graphical user interfaces (GUIs) 481
green threads 225
H
HashMap 107 – 108
.entry() method 110 – 113
HashSet 113
heap 28 – 30
Hello, World! example 16 – 20
helper functions 499
high level 70
hms (hour minutes seconds) 350
I
if let 102, 482
if let syntax 527
immutable references 50
imperative style 153
impl block 81, 148
impl Experienced 141
impl keyword 81, 129
impl Lawyer 141
impl Trait 233, 244 – 248, 260
regular generics compared to 244 – 246
returning closures with 246 – 248
types 327
include_str! macro 391
inclusive range 55
incremental compilation 376
infer verb 14
inner attribute 266
.insert(key, value) method 107
Instant struct 495
Instant::now() function 345
integers 7 – 14, 419 – 423
Add trait and other similar traits 420 – 423
checked operations 419
interior mutability 189, 199 – 208
Cell 200
Mutex 204 – 206
RefCell 201 – 204
RwLock 207
into_borrowed method 217
.into_iter() method 154, 156, 355
into_owned method 217
.into_string() method 434
.into() method 33, 58
IntoIterator 383
IntoUrl trait 397
io::Result<DirEntry> 521
.is_alphabetic() method 177
.is_none() method 98
.is_some() method 98
isize type 7
Item associated type 157
.iter_mut() method 154, 156, 355
.iter() method 154, 355, 413
Iterator trait 157 – 158, 161
Iterator, arrays implementing 413
iterators 154 – 161, 170 – 185
chaining methods 153
checking 177 – 180
checking and finding items inside 177 – 180
closures
|_| in 167
lazy and fast 164 – 167
closures inside 161 – 168
cycling 180 – 185
filtering 170 – 173
finding items inside 177 – 180
folding 180 – 185
mapping 170 – 173
methods 174 – 185
zipping 180 – 185
J
.join() method 227, 253
JoinHandle 226 – 227
just_makes_an_i32() function 58
K
KeyEvent struct 482 – 483
KoreaJapanUserEvent struct 353
L
lambdas 161
largest numbers 23
laser pointer project 512 – 520
developing code 515 – 517
further development and cleanup 517 – 520
setup and first code 512 – 514
LawyerSkill trait 143
lazy_static crate 341, 366 – 371, 456
overview 366 – 368
lazy_static! macro 367, 456
len_utf() method 418
.len() method 12
lenient language spouse 3
let else 103
let keyword 20, 25
lib.rs file 288
libraries 450
Library struct 158
LifetimeParam 324
lifetimes 189, 324
&str 189
annotations 190 – 199
in functions 191
in types 192 – 195
anonymous lifetime 195 – 199
interior mutability 199 – 208
line! macro 454, 473
LocalKey type 458
.lock() method 398
Logger struct 367, 369
loops 66 – 70
low level 70
M
macros 437, 461
keeping code clean with 475 – 479
reading from standard library 470 – 475
reasons for 462
standard library 451 – 460
cfg! macro 458 – 460
column! macro 454
file! macro 454
line! macro 454
macro_rules! macro 463
matches! macro 474
module_path! macro 454
thread_local! macro 456 – 458
unreachable! macro 452 – 454
todo! macro 212 – 214
writing 463 – 470
main.rs file 288
main() function 16, 514
main() method 369
.make_book() function 214
make_fear_closure() function 247
.map_while() method 182
.map() method 156, 170, 174, 414 – 415
mapping 170 – 173
mapping arrays 414
match guard 63
match keyword 52, 101
match statements 61 – 65
.match_indices() method 183
math() function 294 – 296
::MAX 23
.max() method 424
maximum length 49
MedicalSkill trait 143
mem module 12, 437
mem::drop() function 438
mem::take() function 446 – 447
memory 28 – 30
const and static 33
Copy types 42 – 45
std::mem module 437 – 442
strings 30 – 33
memory allocation 34
.metadata() method 521
method chaining 152
method signatures 131 – 135
methods 71, 81
closures inside 163 – 164
ending in _unchecked 334
::MIN 23
.min_width() method 524
.min() method 424
minimum length 49
mod city module 286
mod country module 286
mod keyword 288, 293
mod province module 286
modules 283 – 289
basics of 283
modules inside modules 286 – 289
pub keyword 285
monomorphism 377
MonsterBehavior trait 138
move keyword 229 – 231
move semantics 42
Mul trait 422
MulAssign trait 422
mut keyword 54
mut self 307
mutability 24
interior 199 – 208
Cell 200
Mutex 204 – 206
RefCell 201 – 204
RwLock 207
static mut 331 – 332
mutable references 35 – 38, 50
only immutable references 37
only one mutable reference 37
problem situation 37
mutable statics 328
Mutex 204 – 206, 250, 254
Mutex<String> 367
my_number as char problem 10
MyType type 92
N
Naive types 350
$name, ident identifier 469
Neg trait 422
newtypes 147 – 149
NewUserRequest struct 343
.next() method 156 – 157, 159, 265
num_bigint crate 420
num_to_parse String 296
numbers, smallest and largest 23
O
.ok_or_else() method 172 – 173
.ok_or() method 172
.ok() method 170 – 172, 175
OKAY_CHARACTERS const 295
once_cell crate 341, 366, 368 – 371
lazy_static 366 – 368
OnceCell 369 – 371
OnceCell::new() method 369
open_file() function 458
open() method 389
OpenOptions 389 – 392
OpenOptions struct 390
Operation enum 299
Option 90, 95 – 105, 156, 174, 438
options() method 390
_or_else methods 172
.or_insert() method 110 – 111
orphan rule 147 – 149
OS threads 225
OsString 434
outer attribute 266
Output type 403
ownership 28
references to functions 38 – 42
P
padding characters 49
Painter 516
panic 96
panic hooks 437, 442 – 447
panic! macro 122 – 126, 289, 442 – 443
PanicInfo struct 443 – 444
par_chars() method 355
par_into_iter() method 355
par_iter_mut() method 355
par_iter() method 355
Paragraph widget 493
parse_and_log_str() function 118
parse_int() function 120
.parse() method 104, 122, 172
PartialEq trait 422
PartialOrd trait 94, 422
.path() method 521
pattern matching 98
if let 102
let else 103
while let 104
Pattern trait 184
.payload() method 444
.peekable() method 184
Pin 402
pointer address 48
pointer_hover_pos() method 516
pointers 29 – 30
poll() method 403, 496
polymorphic functions 377
.pop() method 159, 433, 522
popular crates
lazy_static and once_cell 366 – 371
serde crate 342 – 344
Pos2 struct 515
Position struct 133
.position() method 179
prelude section 211
prelude, standard library 450
pretty printing 22
primitive types 7 – 14
print_all_three_things() function 122
print_country() function 39 – 40
print_item() function 92
print_names() method 85
print_number() function 43
print_things module 283
printing 16 – 20, 22, 46 – 51
println! macro 231, 471
prints_country() function 43 – 44
process_city_values() function 84
programmers 4
Programming Rust 461
programs 4
prototyping 212
pub keyword 149, 285
.push_str() method 509
.push() method 56, 522
Q
qualifications, traits as 142
Quantity type 319
R
rand crate
rolling dice with 337 – 339
using 336
rand keyword 374
RangeInclusive struct 515
ratatui crate 492, 501, 512
Rayon crate 341, 354 – 357
Rc (reference counter) 219 – 225, 250
avoiding lifetime annotations with 223 – 225
using in practice 220 – 223
why Rc exists 219
.read_line() method 380
read_to_string() method 389, 483
.read() method 390, 481
ReadDir 521
reading documentation 262 – 271
[src] button 264
assert_eq! 262
attributes 265 – 271
searching 264
traits 265
Rect struct 515
.recv() method 258 – 259
ref mut i32 35
RefCell 201 – 204
reference cycle 222
references 30, 34, 87
mutable references 35 – 38
only immutable references 37
only one mutable reference 37
problem situation 37
to functions 38 – 42
referencing 36
--release part 380
Rem trait 422
.render_widget() method 493
.replace() function 439
request_repaint() method 517
RequestBuilder struct 397
reqwest crate 366, 371, 397 – 399, 401 – 402, 406
reqwest::Client 366
Response struct 401
Result enum 90, 95 – 105, 174
retain() method 434
return_item() function 91
.rev() method 178
RichText struct 522
.round() method 423
run_native() method 514
.run() method 131
Rust
backtraces 447 – 450
basics of 1
files 388 – 392
creating 388
opening existing 389
OpenOptions 389 – 392
installing
accessing command-line arguments 382 – 385
accessing environment variables 385 – 387
on computer 373
through stdin 380 – 382
working with user input 380 – 387
overview of 2 – 6
unsafe Rust 329 – 335
methods ending in _unchecked 334
overview of 329
transmute() function 332 – 334
using static mut in 331 – 332
rustc compiler 374
Rustonomicon, The 330
RwLock 207
S
SaysHello 362
scoped threads 253, 256
screen_rect() method 516, 524
searching 264
select! macro 408
self keyword 71
Self type 82
.send() method 257 – 258
Sense enum 516
serde crate 341 – 344, 488
serde_json crate 343, 488
serde_json::from_str() function 489
serde_yaml crate 343
Serialize attribute 342 – 343
.serve() method 505
set_hook() method 443
set_var() method 291, 387
.set() method 369
shadowing 25 – 27
short circuit 178
shrink_to_fit() method 433
size_of_val() function 31, 437
size_of() function 12, 437
skinny arrow 18
.skip_while() method 182
.skip() method 383
sleep() function 407
slices 55
smallest numbers 23
smurf 310
.sort_unstable() method 430
.sort() method 430
spawn() function 226 – 227, 229, 231, 351
specialized definition 377
.split_at_mut() method 431
.split_at() method 431
src button 264
src/main.rs 122
stack 28 – 30
standard library 412, 437
arrays 413 – 417
destructuring and mapping 414
implementing Iterator 413
using from_fn() to make 415 – 417
associated items and associated constants 424 – 428
bool 428
char 417
floats 423
integers 419 – 423
Add trait and other similar traits 420 – 423
checked operations 419
macros 451 – 460
cfg! macro 458 – 460
column! macro 454
file! macro 454
line! macro 454
module_path! macro 454
thread_local! macro 456 – 458
unreachable! macro 452 – 454
panic hooks 442 – 447
prelude 450
reading macros from 470 – 475
String 432 – 434
time crate 344 – 349
tour of 437
.start() method 507
State type 512
static methods 81
static mut 331 – 332
statics, mutable 328
status() method 449
std library 437
std::backtrace module 447
std::cell::OnceCell 370
std::cmp::max() function 424
std::cmp::min() function 424
std::env::args() method 382
std::env::set_var() function 292, 386
std::env::var() function 291
std::env::vars() function 385
std::ffi module 434
std::fs module 388 – 389
std::fs::read_dir() function 521
std::fs::write() function 388
std::io module 382
std::io::Write trait 388
std::mem module 12, 437 – 442
std::mem::size_of_val() function 78
std::ops::Add 129
std::panic module 442
std::sync::mpsc 256
std::sync::OnceLock 370
std::thread module 355
std::thread::sleep() function 348
std::thread::spawn() function 225
std::time module 344
Stdin struct 380
stdin() function 380
Stopwatch struct 496
Stream trait 410
strict Rust spouse 3
string slice 30
String type 30, 32 – 33, 128, 148 – 151, 342, 434
String::from_utf8() method 121 – 122
String::new() method 507
String::with_capacity() method 432
strings 7 – 14, 30 – 33
strong_count() method 221
structs 72 – 83
implementing 81 – 83
Sub trait 422
Sub<Instant> 345
SubAssign trait 422
Subtract variant 299
Subtractor struct 294
.sum() method 182
.swap() function 438 – 439
SystemError enum 363
SystemTime struct 347
T
.take_damage() method 138 – 139
take_fifth() function 99
.take_guess() method 509
take_hook() method 446
.take_while() method 182
take() function 438, 440 – 441
.take() method 153, 160, 182
terminal stopwatch and clock 492 – 502
developing code 495 – 498
further development and cleanup 499
setup and first code 492 – 494
test-driven development (TDD) 282, 293 – 302
building calculator 294 – 296
putting calculator together 296 – 302
testing 282, 289 – 293
and test-driven development 293 – 302
crates 283
modules 283 – 289
basics of 283
modules inside modules 286 – 289
pub keyword 285
when tests fail 290 – 292
writing multiple tests 292
TextEdit 524
.then_some() method 412, 429
.then() method 429
thiserror crate 341, 360 – 362
thread_local! macro 456 – 458
thread::scope() method 254
thread::spawn() method 351
threads 209, 225 – 233
cloning on write 215 – 219
move keyword 230
spawning 225 – 227
type aliases 214
types of closures 229
waiting for to finish 227 – 229
time crate 344 – 349
time module 341
TimeOfDay enum 247
.to_digit() method 346
.to_string() method 134, 364
todo! macro 212 – 214, 471
token parser 463
ToOwned trait 216
ToString trait 134 – 135, 364
trait bounds 137, 327
Trait Implementations 42 – 43
trait objects 242, 277
trait word 22
traits 128 – 145
as bounds 140 – 142
as qualifications 142
AsRef trait 149 – 151
blanket trait implementations 362 – 366
From trait 145 – 147
information on 265
method signatures 131 – 135
more complex examples 135 – 140
orphan rule 147 – 149
putting Box around 273 – 276
transferring ownership 50
transmute() function 332 – 335
.trim_end_matches() method 297
.trim_left_matches() method 297
.trim_right_matches() method 297
.trim_start_matches() method 297
.trim() method 381
.trunc() method 423
.truncate() method 390
try_join! macro 409
.try_lock() method 206
.try_recv() method 258
TryFrom trait 476, 478
tt (token tree) 468
TUI (text- or terminal-based user interface) 492
tui crate 492
tuples 58 – 60
type aliases 214
type erasure 277
type inference 14
TypeParam 324
types 71
building 71 – 88
destructuring 83 – 87
dot operator 87
references 87
See also enums; structs
collection types 53 – 60
arrays 53 – 55
tuples 58 – 60
vectors 55 – 58
control flow 60 – 70
basic 60
loops 66 – 70
match statements 61 – 65
Copy types 42 – 45
inference 14
lifetime annotations in 192 – 195
more complex 52
traits 128 – 145
using multiple 79
typing tutor 481 – 487
developing code 482 – 484
further development and cleanup 484
ideas for further development 486
setup and first code 481
U
Ui struct 513
unfinished projects 480, 503
directory and file navigator 520 – 527
developing code 522 – 524
further development and cleanup 524 – 526
setup and first code 521
setup for 481
terminal stopwatch and clock 492 – 502
developing code 495 – 498
further development and cleanup 499
setup and first code 492 – 494
Wikipedia article summary searcher 487 – 492
developing code 488
further development and cleanup 490
setup and first code 487
word-guessing game 504 – 512
developing code 506 – 509
further development and cleanup 509 – 512
setup and first code 504 – 506
unit type 58
UNIX_EPOCH const 347
unreachable! macro 452 – 454
unsafe keyword 329 – 330
unsafe Rust 323, 329 – 335
methods ending in _unchecked 334
overview of 329
transmute() function 332 – 334
using static mut in 331 – 332
unwrap method 122 – 126
.unwrap_err() method 361
.unwrap_or_default() method 306
.unwrap_or_else() method 163, 172
.unwrap_or() method 163, 172
.unwrap() method 97, 257, 289, 435, 485, 490, 523
.update() method 265, 513, 517
ureq crate 487
use keyword 77 – 78
use of moved value 39
use statement 252, 451
user input 380 – 387
accessing command-line arguments 382 – 385
accessing environment variables 385 – 387
through stdin 380 – 382
UserName(String type) 342
usize type 7
UTF-8 31
V
values, variables without 45
var() method 387
variable names 49
variant 75
Vars 385
Vec type 55 – 56, 147, 227, 412, 430 – 432
Vec::new() method 507
Vec::with_capacity() method 57
vec! macro 56
Vec2 struct 515
VecDeque 117
vectors 55 – 58
W
web servers
word-guessing game 504 – 512
developing code 506 – 509
further development and cleanup 509 – 512
setup and first code 504 – 506
where keyword 94
while let 104
_while methods 182
Wikipedia article summary searcher 487 – 492
developing code 488
further development and cleanup 490
setup and first code 487
.windows() method 183
.with_state() method 509, 512
.with() method 456
word-guessing game 504 – 512
developing code 506 – 509
further development and cleanup 509 – 512
setup and first code 504 – 506
.write_all() method 388
write_fmt() method 471
write! macro 133, 390, 470
.write() method 390
Y
ymd (year month day) 350
Z
zero-cost abstractions 166
.zip() method 166, 180
zipping 180 – 185