Trait fred::interfaces::LuaInterface

source ·
pub trait LuaInterface: ClientLike + Sized {
    // Provided methods
    fn script_load<R, S>(
        &self,
        script: S,
    ) -> impl Future<Output = RedisResult<R>>
       where R: FromRedis,
             S: Into<Str> { ... }
    fn script_load_cluster<R, S>(
        &self,
        script: S,
    ) -> impl Future<Output = RedisResult<R>>
       where R: FromRedis,
             S: Into<Str> { ... }
    fn script_kill(&self) -> impl Future<Output = RedisResult<()>> { ... }
    fn script_kill_cluster(&self) -> impl Future<Output = RedisResult<()>> { ... }
    fn script_flush(&self, async: bool) -> impl Future<Output = RedisResult<()>> { ... }
    fn script_flush_cluster(
        &self,
        async: bool,
    ) -> impl Future<Output = RedisResult<()>> { ... }
    fn script_exists<R, H>(
        &self,
        hashes: H,
    ) -> impl Future<Output = RedisResult<R>>
       where R: FromRedis,
             H: Into<MultipleStrings> { ... }
    fn script_debug(
        &self,
        flag: ScriptDebugFlag,
    ) -> impl Future<Output = RedisResult<()>> { ... }
    fn evalsha<R, S, K, V>(
        &self,
        hash: S,
        keys: K,
        args: V,
    ) -> impl Future<Output = RedisResult<R>>
       where R: FromRedis,
             S: Into<Str>,
             K: Into<MultipleKeys>,
             V: TryInto<MultipleValues>,
             V::Error: Into<RedisError> { ... }
    fn eval<R, S, K, V>(
        &self,
        script: S,
        keys: K,
        args: V,
    ) -> impl Future<Output = RedisResult<R>>
       where R: FromRedis,
             S: Into<Str>,
             K: Into<MultipleKeys>,
             V: TryInto<MultipleValues>,
             V::Error: Into<RedisError> { ... }
}
Available on crate feature i-scripts only.
Expand description

Functions that implement the lua interface.

Provided Methods§

source

fn script_load<R, S>(&self, script: S) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<Str>,

Load a script into the scripts cache, without executing it. After the specified command is loaded into the script cache it will be callable using EVALSHA with the correct SHA1 digest of the script.

Returns the SHA-1 hash of the script.

https://redis.io/commands/script-load

source

fn script_load_cluster<R, S>( &self, script: S, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<Str>,

Available on crate feature sha-1 only.

A clustered variant of script_load that loads the script on all primary nodes in a cluster.

Returns the SHA-1 hash of the script.

source

fn script_kill(&self) -> impl Future<Output = RedisResult<()>>

Kills the currently executing Lua script, assuming no write operation was yet performed by the script.

https://redis.io/commands/script-kill

source

fn script_kill_cluster(&self) -> impl Future<Output = RedisResult<()>>

A clustered variant of the script_kill command that issues the command to all primary nodes in the cluster.

source

fn script_flush(&self, async: bool) -> impl Future<Output = RedisResult<()>>

Flush the Lua scripts cache.

https://redis.io/commands/script-flush

source

fn script_flush_cluster( &self, async: bool, ) -> impl Future<Output = RedisResult<()>>

A clustered variant of script_flush that flushes the script cache on all primary nodes in the cluster.

source

fn script_exists<R, H>(&self, hashes: H) -> impl Future<Output = RedisResult<R>>

Returns information about the existence of the scripts in the script cache.

https://redis.io/commands/script-exists

source

fn script_debug( &self, flag: ScriptDebugFlag, ) -> impl Future<Output = RedisResult<()>>

Set the debug mode for subsequent scripts executed with EVAL.

https://redis.io/commands/script-debug

source

fn evalsha<R, S, K, V>( &self, hash: S, keys: K, args: V, ) -> impl Future<Output = RedisResult<R>>

Evaluates a script cached on the server side by its SHA1 digest.

https://redis.io/commands/evalsha

Note: Use None to represent an empty set of keys or args.

source

fn eval<R, S, K, V>( &self, script: S, keys: K, args: V, ) -> impl Future<Output = RedisResult<R>>

Evaluate a Lua script on the server.

https://redis.io/commands/eval

Note: Use None to represent an empty set of keys or args.

Object Safety§

This trait is not object safe.

Implementors§