Keywords
The following words are reserved and may not be used as identifiers. Keywords are case-sensitive and are listed below in ascending order, each linked to the chapter that describes it in full.
Built-in type names (int, bool, char32, …) are not keywords — they are predefined identifiers in the type namespace. For a consolidated list of them, see the Primitive Type Reference.
| Keyword | Role |
|---|---|
as | Converts a value from one type to another (cast) |
asm | Marks a function whose body is written in assembly |
break | Exits the nearest enclosing loop |
const | Declares a compile-time constant |
continue | Skips to the next iteration of a loop |
else | Introduces the alternative branch of an if |
enum | Declares an enumeration type |
extend | Attaches methods to a type, optionally implementing interfaces |
extern | Declares a function or symbol defined outside Rux |
false | The false boolean value |
for | Iterates over the elements of a sequence |
func | Declares a function |
if | Begins a conditional branch |
import | Brings names from a module into scope |
in | Separates the loop variable from the sequence in a for loop |
interface | Declares an interface |
is | Tests whether a value has a given type |
let | Declares an immutable variable |
loop | Begins an unconditional loop |
match | Selects a branch by pattern matching |
module | Declares a module (namespace) |
null | The null pointer value |
pub | Makes an item visible outside its module |
return | Returns a value from a function |
self | The receiver parameter of a method |
struct | Declares a structure type |
true | The true boolean value |
type | Declares a type alias |
union | Declares a union type |
var | Declares a mutable variable |
while | Loops while a condition holds |