Crate valkey_module

Source

Re-exports§

pub use crate::raw::NotifyEvent;
pub use crate::configuration::ConfigurationValue;
pub use crate::configuration::EnumConfigurationValue;
pub use crate::raw;
pub use crate::rediserror::ValkeyError;
pub use crate::redisvalue::ValkeyValue;
pub use crate::raw::*;

Modules§

alloc
apierror
commands
configuration
defrag
digest
error
key
logging
native_types
raw
rediserror
redisraw
redisvalue
server_events
stream

Macros§

define_extern_c_filter_func
enum_configuration
redis_command
redis_event_handler
valkey_module
Defines a Valkey module.
valkey_module_auth
Registers authentication callbacks with the Valkey module

Structs§

AclPermissions
An object represent ACL permissions. Used to check ACL permission using acl_check_key_permission.
BlockedClient
CallOptions
CallOptionsBuilder
CommandFilter
CommandFilterCtx
Context
Context is a structure that’s designed to give us a high-level interface to the Valkey module API by abstracting away the raw C FFI calls.
ContextFlags
ContextGuard
DetachedContext
This struct allows logging when the Valkey GIL is not acquired. It is implemented Send and Sync so it can safely be used from within different threads.
DetachedContextGuard
This object is returned after locking Valkey from DetachedContext. On dispose, Valkey will be unlocked. This object implements Deref for Context so it can be used just like any Valkey Context for command invocation. This object should not be used to return replies because there is no real client behind this context to return replies to.
DetachedFromClient
A ThreadSafeContext can either be bound to a blocked client, or detached from any client.
FutureCallReply
A future call reply struct that will be return in case the module invoke a blocking command using [call_blocking]. This struct can be used to set unblock handler. Notice that the struct can not outlive the `ctx lifetime, This is because the future handler must be set before the Valkey GIL will be released.
InfoContext
InfoContextFieldBottomLevelData
A type for the key => bottom-level-value storage of an info section.
KeysCursor
RedisBuffer
ThreadSafeContext
ValkeyGILGuard
This struct allows to guard some data and makes sure the data is only access when the Valkey GIL is locked. From example, assuming you module want to save some statistics inside some global variable, but without the need to protect this variable with some mutex (because we know this variable is protected by Valkey lock). For example, look at examples/threads.rs
ValkeyString

Enums§

CallOptionResp
CallReply
ErrorReply
InfoContextBuilderFieldBottomLevelValue
The values allowed in the “info” sections and dictionaries.
InfoContextBuilderFieldTopLevelValue
PromiseCallReply

Constants§

AUTH_HANDLED
AUTH_NOT_HANDLED
TYPE_METHOD_VERSION
VALKEY_OK

Statics§

MODULE_CONTEXT
The detached Valkey module context (the context of this module). It is only set to a proper value after the module is initialised via the provided [redis_module] macro. See DetachedContext.

Traits§

NextArg
ValkeyLockIndicator
Whenever the user gets a reference to a struct that implements this trait, it can assume that the Valkey GIL is held. Any struct that implements this trait can be used to retrieve objects which are GIL protected (see [RedisGILGuard] for more information)

Functions§

basic_info_command_handler
Default “INFO” command handler for the module.
decode_args
init_api
Initialize RedisModuleAPI or ValkeyModuleAPI without register as a module.

Type Aliases§

CallResult
InfoContextFieldTopLevelData
A type alias for the key => top-level-value storage of an info section.
InfoHandlerFunctionType
A type alias for the custom info command handler. The function may optionally return an object of one section to add. If nothing is returned, it is assumed that the function has already filled all the information required via InfoContext::builder.
LogLevelDeprecated
OneInfoSectionData
One section contents: name and children.
ValkeyResult
A short-hand type that stores a std::result::Result with custom type and [RedisError].
ValkeyValueResult
A [RedisResult] with ValkeyValue.