This post has code examples for Actix-Web Basic and Bearer authentications. In a Basic authentication scheme, a client transmits credentials as user Id and password pairs in base64 format. Meanwhile, a client sends a string token in a Bearer authentication.
We can now install Rust on Windows a lot easier on Windows 11 (and probably in Windows 10 too) than before with the new Rust installer. Previously, we would go through a number steps to install Rust on Windows. The
Applications do not solely rely on databases or end-users as their primary data source. This fact is no less actual in complex applications. We can retrieve data from (or send to) a multitude of other sources like SFTP, queues, and
In any programming language, strings are essential. We’ll be hard-pressed to find any real-life application that doesn’t rely on strings. One of the everyday operations on strings is comparison. We can use the eq(), eq_ignore_ascii_case(), and == to compare strings
Rust does not have a switch keyword but the match keyword that works like a switch examples in other languages like Java and C++. Generally, the match can run codes or return a single value. It cannot do both at
Variables in Rust are similar to variables in other high-level programming languages, and how we declare and use them is pretty straightforward. There are several types of variables, and their declaration may differ from each other. Types Of Variables In
99% of the time, we deal with strings, which are a sequence of characters, and here are the things you need to know about them when learning Rust. 1. There Are 2 Types of String in Rust: String and str
Can we use a layered architecture pattern in a Rust codebase? Like using controller, service, and persistent layers? Yes, we can, but we may need to implement it slightly differently than in most programming languages like Java, C#, etc. How
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
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.