Errors are a part of Software, and Rust has features to terminate an application using the panic macro and handle failures gracefully with the Result enum. These Rust’s features are similar to the concept of exception handling in other programming
Actix-Web: The Most Fun Rust Web Framework Is Back!
The most fun Rust web framework is back with a new project leader! I feel relieved by its comeback. Today, I was trying out one of the alternatives to Actix-web. But I was having difficulties making it read and parse
10 Alternatives To The Defunct Actix-Web
People have started looking for 10 alternatives to the now-defunct Actix-web since its death. Some may end up forking Actix-web and evolve it into something uniquely theirs. Others may have started porting their applications to other frameworks or even out of Rust.
Have You Started Using Actix-Web? It May Already Be Dead
Have you started using Actix-Web in your learning of Rust or real projects? Actix-web is now dead and no longer an open-source project. The author has moved it, along with Actix-Net, to his personal GitHub account. He is taking his
Pattern Matching for Declarative Macros in Rust
Macros are like functions but only better. They are triggered based on their patterns using pattern matching for declarative Macros. They group together our codes into a unit (or units) and there are 2 types of macros in Rust – declarative and procedural. This brief post is about declarative macros.
How to use Local Unpublished Crates
At some point in learning Rust, we will encounter the need to create our own crates. They need to go through development and testing before there are published to creates.io. This brief post is about creating and using local unpublished crates.
Using #[non_exhaustive] for Non-exhaustive Rust Structs
Non-exhaustive structs will future-proof our codes. We use Struct expressions to instantiate structs and they’re JSON-like expression in appearance with all fields present. When we update a struct with a new field, all expressions must be updated to include that field.
Using #[non_exhaustive] for Non-exhaustive Enums
Using non-exhaustive enums in one crate prevents codes in other crates from listing all the possible matches in a match expression. It forces developers to use wildcards for future-proofing.
How to Read Input from Console Examples
In Rust, we can read user inputs from the command-line console. These inputs are string values with newline characters at the end. Most of the time, we do not want those extra characters. This post provides three simple example codes
How to use State Design Pattern in Rust
Anything has a state. An entity has a state. Similarly, a car can be in a state of acceleration. While it is accelerating, there are some things it certainly cannot or should not do, e.g., reversing at that very moment. The State Design Pattern treats each state as a struct whose functions represent movements to the other states.