How to Match a String Against String Literals
1. Overview As we know, we can represent text as a String or string literal (&str) in Rust. A String is a growable, mutable, owned string type, while a string literal is an immutable reference...
C, Java and Rust
1. Overview As we know, we can represent text as a String or string literal (&str) in Rust. A String is a growable, mutable, owned string type, while a string literal is an immutable reference...
1. Overview Converting a string to an integer type is a common task in Rust, especially when working with user input which is primarily text-based. In this tutorial, we’ll learn how to safely and...
1. Overview In this tutorial, we’ll learn through a step-by-step guide on building a CRUD (Create, Read, Update, Delete) REST API using Actix Web and PostgreSQL. We’ll build an API for a simple book...
1. Overview Vector (Vec<T>) is a collection in Rust that allows storing multiple values of the same type in a single data structure. Unlike an array, Vectors can grow or shrink in size. In...
1. Overview In this short tutorial, we’ll discuss how to split a string into two parts using Rust. 2. Using split_at() split_at() method is part of the Rust standard library, it provides easy functionality to...
1. Overview Reading from and writing to files is a common task in the programming world. Rust standard library provides functions to work with files. In this tutorial, we’ll delve into the basics of...
1. Overview Iterating through an Enum value may be tricky in Rust. However, a third-party crate called strum makes the process easier. In this tutorial, we’ll explore how to use strum to iterate over an...
1. Overview In Rust, a vector of bytes (Vec<u8>) represents a resizable array of 8-bit unsigned integers. in this tutorial, we explore different ways to convert a vector of bytes and strings. 2. Understanding byte...
1. Overview In Rust, a binary is an executable file that serves as an entry point to a program. By default, a typical Rust project consists of a single binary. However, with some configurations,...