Definitions
Definitions in Rell create reusable code components, including entities, objects, structs, enums, queries, operations, and functions. Abstract modules serve as templates, namespaces organize code, and external modules enable cross-blockchain access. Mount names provide flexible identification and mapping of components.
EntityEntities store data long-term, with unique IDs and support relationships through keys and indices. The
@log annotation makes them immutable.ObjectObjects are singleton structures initialized at startup, with default attributes that cannot be created or deleted
by code.StructStructs are in-memory structures with default or mutable attributes, managed by the garbage collector, and can
encapsulate function parameters.EnumEnums are sets of constants with unique integer values and built-in functions like T.values() to list
values.QueryQueries return GTV-compatible data and do not modify the database, with simple or explicit return statement
options.OperationOperations modify data, have no return value, and are declared with the operation keyword. The
require statement enforces execution conditions.FunctionFunctions offer reusable logic, support various return types, and include features like default parameters, named
arguments, and partial application.Abstract moduleAbstract modules and functions provide templates for customization. Client modules import and override these
components to create functional versions.NamespaceNamespaces group related modules, entities, and functions for better code organization.Size constraint annotationsThe @size, @min_size, and @max_size annotations put size limits on text and
byte array values in parameters, struct attributes, and entity and object attributes.Mount namesMount names identify components and map entities/objects to SQL tables. The @mount annotation
customizes names with support for relative naming using . (append) and ^ (remove).