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.

KeywordRole
asConverts a value from one type to another (cast)
asmMarks a function whose body is written in assembly
breakExits the nearest enclosing loop
constDeclares a compile-time constant
continueSkips to the next iteration of a loop
elseIntroduces the alternative branch of an if
enumDeclares an enumeration type
extendAttaches methods to a type, optionally implementing interfaces
externDeclares a function or symbol defined outside Rux
falseThe false boolean value
forIterates over the elements of a sequence
funcDeclares a function
ifBegins a conditional branch
importBrings names from a module into scope
inSeparates the loop variable from the sequence in a for loop
interfaceDeclares an interface
isTests whether a value has a given type
letDeclares an immutable variable
loopBegins an unconditional loop
matchSelects a branch by pattern matching
moduleDeclares a module (namespace)
nullThe null pointer value
pubMakes an item visible outside its module
returnReturns a value from a function
selfThe receiver parameter of a method
structDeclares a structure type
trueThe true boolean value
typeDeclares a type alias
unionDeclares a union type
varDeclares a mutable variable
whileLoops while a condition holds