Mukul Latiyan has Published 474 Articles

Arrays in Rust Programming

Mukul Latiyan

Mukul Latiyan

Updated on 03-Apr-2021 13:58:35

479 Views

An array is a data structure that is used to contain objects of the same type T. These objects are stored in contiguous memory locations.In Rust, the arrays are created by making the use of [ ] brackets. It is important that the size of the arrays must be known at ... Read More

Struct Visibility in Rust Programming

Mukul Latiyan

Mukul Latiyan

Updated on 03-Apr-2021 13:31:24

1K+ Views

Structs in Rust contains an extra level of visibility. These can be modified by the developers as per his/her convenience.In a normal scenario, the visibility of the struct in Rust is private and it can be made public by making use of the pub modifier.It should be noted that this ... Read More

Result Type in Rust Programming

Mukul Latiyan

Mukul Latiyan

Updated on 03-Apr-2021 13:23:47

113 Views

There are two types of errors that occur in Rust, either a recoverable error or an unrecoverable error. We handle the unrecoverable errors with the help of panic!macro and the Result type along with others help in handling the recoverable errors.The Result type is a better version of the Option ... Read More

Program arguments in Rust Programming

Mukul Latiyan

Mukul Latiyan

Updated on 03-Apr-2021 13:21:14

56 Views

Taking care of arguments passed at the runtime is one of the key features of any programming language.In Rust, we access these arguments with the help of std::env::args, which returns an iterator that gives us a string for each passed argument.ExampleConsider the example shown below −use std::env; fn main() { ... Read More

HashSet in Rust Programming

Mukul Latiyan

Mukul Latiyan

Updated on 03-Apr-2021 13:04:16

359 Views

Rust also provides us with a HashSet data structure that is mainly used when we want to make sure that no duplicate values are present in our data structure.If we try to insert a new value into a HashSet that is already present in it, then the previous value gets ... Read More

File Operations in Rust Programming

Mukul Latiyan

Mukul Latiyan

Updated on 03-Apr-2021 12:50:15

223 Views

File operations normally include I/O operations. Rust provides us with different methods to handle all these operations.OpenRust provides an open static method that we can use to open a file in read-only mode.ExampleConsider the code shown below:use std::fs::File; use std::io::prelude::*; use std::path::Path; fn main() {    // Create a path ... Read More

Functions in Rust programming language

Mukul Latiyan

Mukul Latiyan

Updated on 20-Feb-2021 08:09:31

180 Views

Functions are building blocks of code. They allow us to avoid writing similar code and also help in organizing large section of code into reusable components.In Rust, functions can be found everywhere. Even function definitions are also statements in Rust.One of the most important function in Rust is the main ... Read More

Rust programming language – Getting Started

Mukul Latiyan

Mukul Latiyan

Updated on 20-Feb-2021 06:53:00

176 Views

The first part of getting hands-on experience with Rust is installing Rust. In order to install Rust, we need a Rust installer.Rustup is a version management tool and also an installer that helps in installing Rust in your local machine.If you’re running Linux, macOS, or another Unix-like OS, then we ... Read More

Why is Rust Programming language loved so much?

Mukul Latiyan

Mukul Latiyan

Updated on 20-Feb-2021 06:49:30

164 Views

Being voted as the most loved language for four consecutive years, Rust has come a long way.Originally designed as a low-level language, best suited for embedded, systems and critical performance code, it has gained a lot of traction and not stopping yet.Rust also has found its way in web developments ... Read More

Downsides of Rust Programming Language

Mukul Latiyan

Mukul Latiyan

Updated on 20-Feb-2021 06:48:17

2K+ Views

Every programming language has some downsides attached to it, it’s not all roses when it comes to Rust as well. Some of the noticeable downsides of Rust programming language are highlighted here −Compile TimeYes, compile time. Rust is fast, no doubt. But when it comes to compiling code, then it’s ... Read More

Advertisements