Operators
Arithmetic Operators
+ - * / %
💡 Also + is used for array and string concatenation
Comparison Operators
== != < > <= >=
Logical Operators
! && ||
🔎 On integer types, ! inverts the individual bits in the two’s complement representation of the value.
Bitwise Operators
& | ^ << >>
Assignment and Compound Assignment Operators
The = operator is used to assign a name to a value or a function. Compound Assignment Operators are created by composing one of + - * / % & | ^ << >> operators with = operator.
Type Casting Operator
as
Borrowing and Dereference Operators
& &mut *
The & or &mut operators are used for borrowing and * operator for Dereferencing.
🔎 For more information, refer Ownership, Borrowing & Lifetimes sections.
Last updated