We always work with string values. In Rust, we can check if a string value is numeric or not using the function is_numeric() on a char value. That means we look at each character within a string. Rust Codes To
Rust – How to read last few lines of a File
Sometimes we don’t want to load read all the content of a text file. For instance, we only want to see the last several lines. In Rust, we can use a crate called rev_lines to read and display the last
Rust – Validate Email Address using Regular Expressions
This post about validating email addresses in Rust using the crate regex and regular expressions based on this other post.
Rust Selection Sort Recursion and Iteration
This post is about the sorting algorithm Selection Sort in Rust using recursion and iteration. Rust Selection Sort Using Recursion The sample Selection Sort codes in this post that use recursion have 3 functions. The first function bootstraps the recursive
Rust – Convert Struct Instances to and from JSON
In Rust, there are two excellent crates that can convert struct instances to and from JSON. These are perfect for creating RESTful APIs that consume and produce JSON content. These are serde and serde_json crates. Use Rust Crates In Cargo.toml If
Rust – Thread Synchronization using Barrier
This post is about Rust thread synchronization with Barrier using std::sync::Barrier which is part of Rust’s standard library. Therefore, we do not need external dependencies to make things work. Basic Idea of Barrier The basic idea of using barriers is
Rust Display Struct Content Using Directive Or Traits
In Rust, we can display the contents of a struct type without explicitly printing out all the fields it has.
Rust Environment Variables – Set, Update, List And Delete
In Rust, we could get, list, or update environment variables using functions provided in the std::env module.
Rust Framework Rocket Goes Stable With No Exact Date
Rust framework Rocket goes stable, starting with version 0.5 and Rust 1.45.0. No doubt, it is one of the best frameworks out there. However, it requires Rust Nightly. When I started learning Rust, I needed to choose between Actix-Web and
Rust Generics With Structs, Functions, Methods, and Enums
Rust Generics is a language feature for code reuse in multiple contexts using different actual types for Structs, Functions, Methods, and Enums. Moreover, they allow for concise and clean codes by minimizing boilerplates while providing type-safety. When we use Generics,