Crate redis_module_macros

Source

Attribute Macros§

command
This proc macro allow to specify that the follow function is a Redis command. The macro accept the following arguments that discribe the command properties:
config_changed_event_handler
Proc macro which is set on a function that need to be called whenever a configuration change event is happening. The function must accept a [Context] and [&&str] that contains the names of the configiration values that was changed.
cron_event_handler
Proc macro which is set on a function that need to be called on Redis cron. The function must accept a [Context] and u64 that represent the cron hz.
flush_event_handler
Proc macro which is set on a function that need to be called whenever a flush event happened. The function must accept a [Context] and [FlushSubevent].
info_command_handler
A procedural macro which registers this function as the custom INFO command handler. There might be more than one handler, each adding new information to the context.
loading_event_handler
Proc macro which is set on a function that need to be called whenever a loading event happened. The function must accept a [Context] and [LoadingSubevent].
module_changed_event_handler
Proc macro which is set on a function that need to be called whenever a module is loaded or unloaded on the server. The function must accept a [Context] and [ModuleChangeSubevent].
role_changed_event_handler
Proc macro which is set on a function that need to be called whenever the server role changes. The function must accept a [Context] and [ServerRole].

Derive Macros§

InfoSection
Implements a corresponding From for this struct, to convert objects of this struct to an information object to be sent to the [redis_module::InfoContext] as a reply.
RedisValue
The macro auto generate a From implementation that can convert the struct into RedisValue.