This post is about a sorting algorithm called Insertion Sort with recursive and iterative implementations in Rust.
Write XML Tags using Closure in Rust – No Element End Tags
Did you miss writing out an XML element end tag in your Rust codes? There is a convenient way to avoid this in Rust using Closure.
Quicksort Algorithm Example in Rust
This post is about an example of the Quicksort algorithm in Rust. It sorts an array of i32 with 13 elements.
Merge Sort Algorithm in Rust Codes
Merge Sort is an algorithm invented by John von Neumann in 1945 and it is one of the most efficient sorting algorithms. It uses the principle of divide-and-conquer.
Function Accepts Struct That Implements A Trait
This post briefly talks about how to create functions that accept struct instances that implement a specific trait.
Why You Should Choose Rust Stable Over Nightly
If you are new to Rust, choose Rust Stable over Nightly to make your life and other people’s lives simple – may apply to both crate producers and consumers. There are three types of Rust compiler – Nightly, Beta, and
Vec With Specific Trait Type
In this post, we want to create a Vec instance that only accepts struct instances that implements a particular trait.
Actix-Web With MySQL Using R2D2 For Connection Pool
R2D2 is a connection pool for Rust applications, e.g., Actix-Web, that use databases like MySQL. Opening and closing a database connection is an expensive operation. With connection pooling, the database connection creation happens once, and the application can reuse it
How to use Strategy Design Pattern in Rust
This Design Pattern replaces a behavior with different implementation at run-time or sometimes at load-time by means of configuration. Two entities could have different implementations of the same behavior.
How to use Command Design Pattern in Rust
This Design Pattern uses commands to wrap and invoke capabilities. A car can run faster and slower. We can have commands AccelerateCommand and DecelerateCommand for increasing and decreasing speed, respectively. We can also have AccelerateAndDecelerateCommand to run both capabilities in a certain order.