Notes

Structures

Structures(struct) are compound(and user-defined) data types. Structures are much similar to tuples, except that data can named. Structures can be set …

2 Mins #structures #struct 20 May, 2020

Slice Type

Another data type that does not have ownership is the slice. Slices let you reference a contiguous sequence of elements in a collection rather than …

1 Mins #slice 20 May, 2020

References and Borrowing

When a variable is passed by reference to a function parameter, the function does not take ownership of that variable. Instead, it stores a pointer …

2 Mins #references #ownership #borrowing 7 May, 2020

Ownership

Ownership Rules Each value in Rust has a variable that is called its Owner. There can only be one owner at a time. When the owner goes out of scope, …

3 Mins #ownership 26 Apr, 2020

Control Flow

if, if else, else if An if expression allows you to branch your code depending on conditions. fn main(){letnum: i8 =2;ifnum<5{println!("Number …

2 Mins #control-flow #if #if-else 22 Apr, 2020

Functions

Functions are block of codes which are instructed to accomplish specific task(s). To write a function, the fn keyword is used, followed by function …

2 Mins #functions 22 Apr, 2020

Data Types

Every value in Rust is of a certain data type, which tells Rust what kind of data is being specified so it knows how to work with that data. Data …

2 Mins #data-types 21 Apr, 2020

Variables and Mutablity

In Rust, Variables are Immutable by default. Demo Program Immutable // This program won't compile because // the value of `x` has been changed …

3 Mins 20 Apr, 2020

Contact