Expand description
The module system: a Module bundles routes, migrations, hooks and OpenAPI parts under a
name, like a service provider.
Order is deterministic: registration order. Modules’ migrations run in that order (then
the app’s own), their routes are merged in that order, start runs in that order and
shutdown in the reverse order. A name may be registered once.
Build order: for each module in registration order, setup (state values,
authenticators, rate limiters), then register_hooks, then the routes
are assembled. Command-line commands (commands) are collected before the
command line is parsed.
Compatibility promise: methods added to Module later (e.g. permissions) always come
with a default implementation, so a module written today keeps compiling.
Structs§
- Setup
- What a module may contribute in
Module::setup.
Constants§
- MAX_
MODULE_ NAME_ BYTES - The longest module name, in bytes.
- RESERVED_
MODULE_ NAMES - Names a module may not use:
appis the app’s own migrations namespace;coreandnbsare reserved for the framework.
Traits§
- Module
- A pluggable part of the server (chat, storage, leaderboards, a game’s own subsystem).
Functions§
- validate_
module_ name - Check a module name (see
Module::name).