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.
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.
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.
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.
Rust – Read EPCIS 1.2 XML Into Struct Instance
This post is about reading an EPCIS 1.2 XML in a Struct instance.
Async Fn and Await Example in Rust That’ll Open Your Mind
This post provides an example the uses async, async fn, and await for asynchronous processing. The sample codes use the futures crate to block the main function until the asynchronous function completes execution.
Rust – Mutable and Shared Borrowing
There are two types of borrowing in Rust – mutable and shared borrowing.
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.
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.
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