The snippet library.
Small, practical examples. Search by task or narrow things down below.
Collect unique sorted values
Collect unique sorted values in a complete Rust program using the standard library.
Rust✓ Tested
Count values with the entry API
Count values with the entry API in a complete Rust program using the standard library.
Rust✓ Tested
Find common set members
Find common set members in a complete Rust program using the standard library.
Rust✓ Tested
Find members missing from another set
Find members missing from another set in a complete Rust program using the standard library.
Rust✓ Tested
Insert and retrieve a map value
Insert and retrieve a map value in a complete Rust program using the standard library.
Rust✓ Tested
Iterate over keys in sorted order
Iterate over keys in sorted order in a complete Rust program using the standard library.
Rust✓ Tested
Query an ordered map’s key range
Query an ordered map’s key range in a complete Rust program using the standard library.
Rust✓ Tested
Remove an entry and inspect its value
Remove an entry and inspect its value in a complete Rust program using the standard library.
Rust✓ Tested
Update an existing map value
Update an existing map value in a complete Rust program using the standard library.
Rust✓ Tested