Skip to main content

ScriptingCommands

Trait ScriptingCommands 

Source
pub trait ScriptingCommands: CommandExecutor {
Show 20 methods // Provided methods fn eval<'life0, 'life1, 'life2, 'life3, 'async_trait, K, A>( &'life0 self, script: &'life1 str, keys: &'life2 [K], args: &'life3 [A], ) -> Pin<Box<dyn Future<Output = ValkeyResult<ValkeyValue>> + Send + 'async_trait>> where K: 'async_trait + ToValkeyArgs + Send + Sync, A: 'async_trait + ToValkeyArgs + Send + Sync, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn evalsha<'life0, 'life1, 'life2, 'life3, 'async_trait, K, A>( &'life0 self, sha1: &'life1 str, keys: &'life2 [K], args: &'life3 [A], ) -> Pin<Box<dyn Future<Output = ValkeyResult<ValkeyValue>> + Send + 'async_trait>> where K: 'async_trait + ToValkeyArgs + Send + Sync, A: 'async_trait + ToValkeyArgs + Send + Sync, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn script_load<'life0, 'life1, 'async_trait>( &'life0 self, script: &'life1 str, ) -> Pin<Box<dyn Future<Output = ValkeyResult<String>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn script_exists<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, sha1s: &'life1 [&'life2 str], ) -> Pin<Box<dyn Future<Output = ValkeyResult<Vec<bool>>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn script_flush<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ValkeyResult<()>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn fcall<'life0, 'life1, 'life2, 'life3, 'async_trait, K, A>( &'life0 self, function: &'life1 str, keys: &'life2 [K], args: &'life3 [A], ) -> Pin<Box<dyn Future<Output = ValkeyResult<ValkeyValue>> + Send + 'async_trait>> where K: 'async_trait + ToValkeyArgs + Send + Sync, A: 'async_trait + ToValkeyArgs + Send + Sync, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn fcall_ro<'life0, 'life1, 'life2, 'life3, 'async_trait, K, A>( &'life0 self, function: &'life1 str, keys: &'life2 [K], args: &'life3 [A], ) -> Pin<Box<dyn Future<Output = ValkeyResult<ValkeyValue>> + Send + 'async_trait>> where K: 'async_trait + ToValkeyArgs + Send + Sync, A: 'async_trait + ToValkeyArgs + Send + Sync, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn fcall_route<'life0, 'life1, 'life2, 'life3, 'async_trait, K, A>( &'life0 self, function: &'life1 str, keys: &'life2 [K], args: &'life3 [A], route: Route, ) -> Pin<Box<dyn Future<Output = ValkeyResult<ValkeyValue>> + Send + 'async_trait>> where K: 'async_trait + ToValkeyArgs + Send + Sync, A: 'async_trait + ToValkeyArgs + Send + Sync, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn fcall_ro_route<'life0, 'life1, 'life2, 'life3, 'async_trait, K, A>( &'life0 self, function: &'life1 str, keys: &'life2 [K], args: &'life3 [A], route: Route, ) -> Pin<Box<dyn Future<Output = ValkeyResult<ValkeyValue>> + Send + 'async_trait>> where K: 'async_trait + ToValkeyArgs + Send + Sync, A: 'async_trait + ToValkeyArgs + Send + Sync, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn function_load<'life0, 'life1, 'async_trait>( &'life0 self, code: &'life1 str, replace: bool, ) -> Pin<Box<dyn Future<Output = ValkeyResult<String>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn function_delete<'life0, 'life1, 'async_trait>( &'life0 self, library_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = ValkeyResult<()>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn function_flush<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ValkeyResult<()>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn function_flush_options<'life0, 'life1, 'async_trait>( &'life0 self, options: &'life1 FunctionFlushOptions, ) -> Pin<Box<dyn Future<Output = ValkeyResult<()>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn function_list<'life0, 'life1, 'async_trait>( &'life0 self, library_name: Option<&'life1 str>, with_code: bool, ) -> Pin<Box<dyn Future<Output = ValkeyResult<ValkeyValue>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn function_dump<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ValkeyResult<Bytes>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn function_restore<'life0, 'async_trait, P>( &'life0 self, payload: P, policy: FunctionRestorePolicy, ) -> Pin<Box<dyn Future<Output = ValkeyResult<()>> + Send + 'async_trait>> where P: 'async_trait + ToValkeyArgs + Send, Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn function_stats<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ValkeyResult<ValkeyValue>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn function_kill<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ValkeyResult<()>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn script_kill<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ValkeyResult<()>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn script_show<'life0, 'life1, 'async_trait>( &'life0 self, sha1: &'life1 str, ) -> Pin<Box<dyn Future<Output = ValkeyResult<Bytes>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... }
}
Expand description

Scripting and function commands (EVAL, EVALSHA, SCRIPT ..., FCALL, …).

Provided Methods§

Source

fn eval<'life0, 'life1, 'life2, 'life3, 'async_trait, K, A>( &'life0 self, script: &'life1 str, keys: &'life2 [K], args: &'life3 [A], ) -> Pin<Box<dyn Future<Output = ValkeyResult<ValkeyValue>> + Send + 'async_trait>>
where K: 'async_trait + ToValkeyArgs + Send + Sync, A: 'async_trait + ToValkeyArgs + Send + Sync, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Evaluate a Lua script (EVAL). Returns the raw reply.

Source

fn evalsha<'life0, 'life1, 'life2, 'life3, 'async_trait, K, A>( &'life0 self, sha1: &'life1 str, keys: &'life2 [K], args: &'life3 [A], ) -> Pin<Box<dyn Future<Output = ValkeyResult<ValkeyValue>> + Send + 'async_trait>>
where K: 'async_trait + ToValkeyArgs + Send + Sync, A: 'async_trait + ToValkeyArgs + Send + Sync, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Evaluate a cached script by its SHA1 hash (EVALSHA).

Source

fn script_load<'life0, 'life1, 'async_trait>( &'life0 self, script: &'life1 str, ) -> Pin<Box<dyn Future<Output = ValkeyResult<String>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load a script into the script cache, returning its SHA1 (SCRIPT LOAD).

Source

fn script_exists<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, sha1s: &'life1 [&'life2 str], ) -> Pin<Box<dyn Future<Output = ValkeyResult<Vec<bool>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Check whether scripts exist in the cache by SHA1 (SCRIPT EXISTS).

Source

fn script_flush<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ValkeyResult<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Flush the script cache (SCRIPT FLUSH).

Source

fn fcall<'life0, 'life1, 'life2, 'life3, 'async_trait, K, A>( &'life0 self, function: &'life1 str, keys: &'life2 [K], args: &'life3 [A], ) -> Pin<Box<dyn Future<Output = ValkeyResult<ValkeyValue>> + Send + 'async_trait>>
where K: 'async_trait + ToValkeyArgs + Send + Sync, A: 'async_trait + ToValkeyArgs + Send + Sync, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Invoke a function registered with FUNCTION LOAD (FCALL).

Source

fn fcall_ro<'life0, 'life1, 'life2, 'life3, 'async_trait, K, A>( &'life0 self, function: &'life1 str, keys: &'life2 [K], args: &'life3 [A], ) -> Pin<Box<dyn Future<Output = ValkeyResult<ValkeyValue>> + Send + 'async_trait>>
where K: 'async_trait + ToValkeyArgs + Send + Sync, A: 'async_trait + ToValkeyArgs + Send + Sync, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Read-only variant of ScriptingCommands::fcall (FCALL_RO).

Source

fn fcall_route<'life0, 'life1, 'life2, 'life3, 'async_trait, K, A>( &'life0 self, function: &'life1 str, keys: &'life2 [K], args: &'life3 [A], route: Route, ) -> Pin<Box<dyn Future<Output = ValkeyResult<ValkeyValue>> + Send + 'async_trait>>
where K: 'async_trait + ToValkeyArgs + Send + Sync, A: 'async_trait + ToValkeyArgs + Send + Sync, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

FCALL routed to specific cluster node(s) (route). Keyless function calls are commonly invoked with an explicit route (e.g. AllPrimaries); on a standalone client the route is ignored.

Source

fn fcall_ro_route<'life0, 'life1, 'life2, 'life3, 'async_trait, K, A>( &'life0 self, function: &'life1 str, keys: &'life2 [K], args: &'life3 [A], route: Route, ) -> Pin<Box<dyn Future<Output = ValkeyResult<ValkeyValue>> + Send + 'async_trait>>
where K: 'async_trait + ToValkeyArgs + Send + Sync, A: 'async_trait + ToValkeyArgs + Send + Sync, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Read-only FCALL_RO routed to specific cluster node(s) (route). On a standalone client the route is ignored.

Source

fn function_load<'life0, 'life1, 'async_trait>( &'life0 self, code: &'life1 str, replace: bool, ) -> Pin<Box<dyn Future<Output = ValkeyResult<String>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load a function library (FUNCTION LOAD); returns the library name.

Source

fn function_delete<'life0, 'life1, 'async_trait>( &'life0 self, library_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = ValkeyResult<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete a function library (FUNCTION DELETE).

Source

fn function_flush<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ValkeyResult<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Flush all function libraries (FUNCTION FLUSH).

Source

fn function_flush_options<'life0, 'life1, 'async_trait>( &'life0 self, options: &'life1 FunctionFlushOptions, ) -> Pin<Box<dyn Future<Output = ValkeyResult<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Flush all function libraries (FUNCTION FLUSH SYNC|ASYNC).

Source

fn function_list<'life0, 'life1, 'async_trait>( &'life0 self, library_name: Option<&'life1 str>, with_code: bool, ) -> Pin<Box<dyn Future<Output = ValkeyResult<ValkeyValue>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List registered function libraries (FUNCTION LIST). Set with_code to include the library source. Returns the raw structured reply.

Source

fn function_dump<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ValkeyResult<Bytes>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Dump the serialized payload of all function libraries (FUNCTION DUMP).

Source

fn function_restore<'life0, 'async_trait, P>( &'life0 self, payload: P, policy: FunctionRestorePolicy, ) -> Pin<Box<dyn Future<Output = ValkeyResult<()>> + Send + 'async_trait>>
where P: 'async_trait + ToValkeyArgs + Send, Self: Sync + 'async_trait, 'life0: 'async_trait,

Restore function libraries from a FUNCTION DUMP payload (FUNCTION RESTORE).

Source

fn function_stats<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ValkeyResult<ValkeyValue>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get information about the function engine and running function (FUNCTION STATS). Returns the raw structured reply.

Source

fn function_kill<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ValkeyResult<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Kill a running function that made no write commands (FUNCTION KILL).

Source

fn script_kill<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ValkeyResult<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Kill a running script that made no write commands (SCRIPT KILL).

Source

fn script_show<'life0, 'life1, 'async_trait>( &'life0 self, sha1: &'life1 str, ) -> Pin<Box<dyn Future<Output = ValkeyResult<Bytes>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Show the source of a cached script by its SHA1 (SCRIPT SHOW, Valkey 8+).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§