Crate valkey_module_macros

Source

Attribute Macros§

client_changed_event_handler
Proc macro which is set on a function that need to be called whenever a client connects or disconnects on the server. The function must accept a [Context] and [ClientChangeSubEvent].
command
This proc macro allow to specify that the follow function is a Valkey 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 Valkey 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.
key_event_handler
Proc macro which is set on a function that need to be called whenever a key event happened. The function must accept a [Context] and [KeyEventSubevent]. Example:
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].
shutdown_event_handler
Proc macro which is set on a function that need to be called whenever a shutdown event happens. The function must accept a [Context] and u64.

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 [valkey_module::InfoContext] as a reply.
ValkeyValue
The macro auto generate a From implementation that can convert the struct into ValkeyValue.