Standard Library #

Strings
Complete guide to Strings and &strs in Rust — differences between Strings and &strs, create and convert, basic operations of search and replace, split and join, trim, character and byte iteration, format!, advanced manipulation, Cow for efficiency, and conversion to other types.
IO
Complete guide to std::io in Rust — Read and Write traits, stdin and stdout, BufReader and BufWriter, file operations with std::fs, OpenOptions, seek and position, directory management, path handling, environment variables, child processes with std::process, and I/O error handling.
Math
Complete guide to math operations in Rust — math constants, integer and overflow operations, floating point operations, trigonometric functions, logarithms and exponentials, rounding, absolute values, min and max, random numbers with rand, prime numbers, and mathjs crate for advanced needs.
Options & Results
Complete guide to Option and Result in Rust — conceptual differences, pattern matching, method chaining, operator ?, Option and Result combinations, conversions between the two, and idiomatic error handling.
Iterators
Complete guide to Iterators in Rust — trait Iterator, lazy evaluation, adapter map and filter and flat_map, consumer collect and fold and reduce, chaining, custom iterators, and performance comparison with manual loops.
Collections
Complete guide to collections in Rust — Vec, HashMap, HashSet, BTreeMap, BTreeSet, VecDeque, and LinkedList: when to use each, common operations, performance, and idiomatic patterns.
Sync
Complete guide to safe concurrency in Rust — Arc and Mutex for shared state, RwLock for read-heavy workloads, mpsc channels for message passing, Atomic for lock-free operations, and idiomatic concurrency design patterns.
Time & Duration
A complete guide to time and duration in Rust — Duration for time intervals, Instant for monotonic time measurements, SystemTime for calendar time, time formatting and parsing, timeouts on concurrent operations, and simple benchmarking.
Process
Complete guide to std::process in Rust — running child processes with Command, capturing output, stdin piping, environment variables, exit codes, process signals, and idiomatic patterns for building CLI tools and shell scripting.
Net
Complete guide to std::net in Rust — TCP server and client, UDP socket, TcpListener and TcpStream, handling concurrent connections, SocketAddr and IpAddr, timeouts and non-blocking I/O, and when to switch to async networking with Tokio.
About | Author | Content Scope | Editorial Policy | Privacy Policy | Disclaimer | Contact