Rust programming language

Accelerometer as Puncho-o-meter | The “stm32-Discovery Board Sensor”- Part 1

Reading Time: 4 minutes Hello everyone, I hope you are fine and learning every day. In today’s blog, we are going to discuss a Sensor of the stm32-Discovery Board. Using this Sensor we will try to make a Punch-o-meter. This is going to be a series of blogs in which each part will take you nearer to the development of Punch-o-meter using one of the Discovery Sensors. In previous Continue Reading

Test Cases in Rust are simple to write

Reading Time: 4 minutes Rust has been the most loved programming language for the last five years in a row. Rust is a low-level statically-typed multi-paradigm programming language that’s focused on safety and performance. Rust solves problems that C/C++ has been struggling with for a long time, such as memory errors and building concurrent programs. Due to the borrow checker, Rust can prevent data races at compile-time. Data races occur when Continue Reading

How to Tackle Error in Rust Programming

Reading Time: 3 minutes An Error is basically an unexpected behaviour that may lead a program to produce undesired output or terminate abruptly. Error handling is the process of handling the possibility of failure. In Rust, errors can be classified into two major categories. Recoverable UnRecoverable Recoverable Error Recoverable errors are those that do not cause the program to terminate abruptly. Such as a file not found error . Continue Reading

Working on Rust? Must know about Macros

Reading Time: 3 minutes A programmable pattern which translates a certain sequence of input into a preset sequence of output is known as Macros( which stands for macroinstructions). Macros can make tasks less repetitive by representing a complicated sequence of keystrokes, mouse movements, commands, or other types of input. In Rust, We’ve used macros like println! , but we haven’t fully explored what a macro is and how it works. The Continue Reading

How to use Pattern Matching in Rust

Reading Time: 3 minutes Rust has an extremely powerful control flow operator called Match. Pattern matching in Rust works by checking if a place in memory matches a certain pattern. Patterns can be : literal values variable names wildcards, and many other things Destructuring using Pattern Matching Pattern matching can use to destruct following items : Structures Enums Tuples  Destructuring breaks up a value into its component pieces. The syntax used is Continue Reading

Magnetometer as Compass | The stm32f3-Discovery Board Sensor-“Part-2”

Reading Time: 4 minutes Welcome everyone, hope all are doing great and learning each day. So today we are going to take this series further to the next part. In today’s blog, we are going to connect our LEDs with the Direction enum so that we can set the LED on for the particular Direction which will be based on the Magnetic Field readings. We will be working on Continue Reading

Generics : How to use them and Implement them in Rust

Reading Time: 4 minutes When we want to write code for multiple contexts we use Generics. It give us primitives to declare placeholder that allow us to focus less on the specific types. It allows us writing a more concise and clean code by reducing code-duplication and providing type-safety.  Generic Functions In a generic definition, we write the type parameter between open and close angle brackets after the name. In Rust, generic also describes anything that accepts one or more generic type Continue Reading

Magnetometer as Compass | The stm32f3-Discovery Board Sensor-“Part-1”

Reading Time: 4 minutes Hi people, hope you are doing fine. In today’s blog, we are going to build a Compass. Yes, you read it right we are going to build a Compass using a Sensor of the stm32f3 -Discovery Board. In the previous blog, we read about a package named Lsm303dlhc which basically works for the older version of the Discovery board. We do have a newer version of Discovery Continue Reading

Superpowers of Unsafe Rust

Reading Time: 4 minutes In the previous blog, I discussed one of the superpowers of Unsafe Rust which is dereferencing a raw pointer. In this blog, we will see another feature of unsafe rust. Rust has wonderful borrowing and ownership rules that take care of all the memory safety issues. It is one of the leading languages. More than 9 companies including Dropbox, Coursera, Figma, npm, Microsoft, Cloudflare, Facebook, Amazon and Discord use Continue Reading

Connect to the Server using crate “reqwest” | RUST Programming

Reading Time: 3 minutes Hi everyone I hope you all are good and learning every day. So what we are going to discuss today?? Embedded? Microcontroller? No! None of them. Today we are going to talk about the HTTP request in RUST Programming. In the previous blog, we talked about a Valuable Package LSM303DLHC using which we were able to access two of the sensor of the f3 board. Continue Reading

What are the different types of collection in Rust

Reading Time: 4 minutes Rust’s standard library includes a number of very useful data structures called collections. A collection is something that holds zero or more elements in some fashion that allows you to enumerate those elements, add or remove elements, find them and so forth. Rust’s collections can be grouped into four major categories: Sequences Maps Sets Misc Sequences Collection Sequences are supported in many forms in Rust. Vec Continue Reading

RPC to call a Runtime API easily in Substrate

Reading Time: 4 minutes RPC or Remote Procedural Call in Substrate is a way to interact with a Substrate node. They can be used for checking storage values, submitting transactions or querying the current consensus authorities. Substrate is a next-generation framework for blockchain innovation. It comes with everything you need to build your blockchain. Substrate is a completely free and open-source project. It is built using Rust and WebAssembly. Rust Continue Reading

“LSM303DLHC” – A Valuable Package.

Reading Time: 4 minutes Hi again, what are we going to discuss today? Okay, so we are going to discuss a package which is named “LSM303DLHC“. Don’t take this package as an ordinary one because it is a valuable package. You will know its value soon. In previous blogs we talked about – Communication with the Hardware, Capabilities of minicomputers and much more. If you want to read more Continue Reading