Skip to main contentKeywords
Reserved Keywords
| Keyword | Description |
|---|
and | Logical AND |
break | Exit loop |
effect | Effect function marker |
else | Else branch |
false | Boolean false |
fn | Function |
for | For loop |
if | Conditional |
import | Import declaration |
in | For loop iterator |
let | Immutable binding |
loop | Infinite loop |
match | Pattern matching |
memo | Memoized function |
module | Module declaration |
not | Logical NOT |
or | Logical OR |
pub | Public visibility |
return | Return statement |
true | Boolean true |
type | Type definition |
var | Mutable binding |
while | While loop |
Built-in Type Names
| Type | Description |
|---|
bool | Boolean |
char | Unicode character |
f32, f64 | Floating point |
i8, i16, i32, i64, i128 | Signed integers |
u8, u16, u32, u64, u128 | Unsigned integers |
string | UTF-8 string |
void | No value |
Option | Optional value |
Result | Success or error |
List | Linked list |
Built-in Constructors
| Constructor | Type |
|---|
Some(x) | Option[T] |
None | Option[T] |
Ok(x) | Result[T, E] |
Err(e) | Result[T, E] |
Cons(h, t) | List[T] |
Nil | List[T] |