Appendix A: Keywords
In this chapter, we'll explore mana's reserved keywords and their meanings.
Appendix A: Keywords
The following is a list of keywords reserved by the Mana language.
Keywords Currently in Use
| Keyword | Description |
|---|---|
break | Exit a loop immediately |
const | Define a constant |
continue | Skip to the next loop iteration |
defer | Execute code when leaving scope |
else | Fallback for if and if let |
enum | Define an enumeration |
false | Boolean false literal |
fn | Define a function |
for | Loop over items from an iterator |
generic | Define generic type parameters |
if | Branch based on a condition |
impl | Implement functionality for a type |
import | Import items from another module |
in | Part of for loop syntax |
let | Bind a variable |
loop | Loop unconditionally |
match | Match a value to patterns |
module | Define a module |
mut | Denote mutability |
None | Option variant for no value |
pub | Denote public visibility |
return | Return from function |
self | Current module or instance |
Some | Option variant with a value |
struct | Define a structure |
super | Parent module of current module |
trait | Define a trait |
true | Boolean true literal |
type | Define a type alias |
use | Bring symbols into scope |
where | Denote clauses that constrain a type |
while | Loop while condition is true |
Reserved for Future Use
| Keyword | Potential Use |
|---|---|
async | Asynchronous operations |
await | Await an async operation |
dyn | Dynamic dispatch |
extern | External code linking |
macro | Define a macro |
move | Make a closure take ownership |
ref | Bind by reference |
static | Global variable or static lifetime |
unsafe | Code that requires manual safety verification |
virtual | Virtual dispatch |
yield | Generator yield |