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> { ... }
}i-scripts only.Expand description
Functions that implement the lua interface.
Provided Methods§
sourcefn script_load<R, S>(&self, script: S) -> impl Future<Output = RedisResult<R>>
fn script_load<R, S>(&self, script: S) -> impl Future<Output = RedisResult<R>>
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.
sourcefn script_load_cluster<R, S>(
&self,
script: S,
) -> impl Future<Output = RedisResult<R>>
Available on crate feature sha-1 only.
fn script_load_cluster<R, S>( &self, script: S, ) -> impl Future<Output = RedisResult<R>>
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.
sourcefn script_kill(&self) -> impl Future<Output = RedisResult<()>>
fn script_kill(&self) -> impl Future<Output = RedisResult<()>>
Kills the currently executing Lua script, assuming no write operation was yet performed by the script.
sourcefn script_kill_cluster(&self) -> impl Future<Output = RedisResult<()>>
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.
sourcefn script_flush(&self, async: bool) -> impl Future<Output = RedisResult<()>>
fn script_flush(&self, async: bool) -> impl Future<Output = RedisResult<()>>
Flush the Lua scripts cache.
sourcefn script_flush_cluster(
&self,
async: bool,
) -> impl Future<Output = RedisResult<()>>
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.
sourcefn script_exists<R, H>(&self, hashes: H) -> impl Future<Output = RedisResult<R>>
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.
sourcefn script_debug(
&self,
flag: ScriptDebugFlag,
) -> impl Future<Output = RedisResult<()>>
fn script_debug( &self, flag: ScriptDebugFlag, ) -> impl Future<Output = RedisResult<()>>
Set the debug mode for subsequent scripts executed with EVAL.
sourcefn 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 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>,
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.
sourcefn 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>,
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>,
Evaluate a Lua script on the server.
https://redis.io/commands/eval
Note: Use None to represent an empty set of keys or args.