Crate redis_module_macros
source ·Attribute Macros
- 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:
- 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.
- 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.
- 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].
- 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. - 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].
- 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].
- 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
- 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. - The macro auto generate a From implementation that can convert the struct into RedisValue.