Struct fred::clients::Transaction
source · pub struct Transaction { /* private fields */ }
transactions
only.Expand description
A cheaply cloneable transaction block.
-Implementations§
source§impl Transaction
impl Transaction
sourcepub fn watched_len(&self) -> usize
pub fn watched_len(&self) -> usize
Read the number of keys to WATCH
before the starting the transaction.
sourcepub async fn exec<R>(&self, abort_on_error: bool) -> Result<R, RedisError>where
+Transaction in fred::clients - Rust Struct fred::clients::Transaction
source · pub struct Transaction { /* private fields */ }
Available on crate feature transactions
only.Expand description
A cheaply cloneable transaction block.
+Implementations§
source§impl Transaction
sourcepub fn pipeline(&self, val: bool)
Whether to pipeline commands in the transaction.
+Note: pipelined transactions should only be used with Redis version >=2.6.5.
+sourcepub fn watched_len(&self) -> usize
👎Deprecated since 9.2.0: Please use WATCH
with clients from an ExclusivePool
instead.
Read the number of keys to WATCH
before the starting the transaction.
+sourcepub async fn exec<R>(&self, abort_on_error: bool) -> Result<R, RedisError>where
R: FromRedis,
Executes all previously queued commands in a transaction.
If abort_on_error
is true
the client will automatically send DISCARD
if an error is received from
any of the commands prior to EXEC
. This does not apply to MOVED
or ASK
errors, which wll be followed
@@ -22,11 +24,11 @@
assert_eq!((foo, bar), (1, 2));
Ok(())
}
-sourcepub fn watch_before<K>(&self, keys: K)where
- K: Into<MultipleKeys>,
Send the WATCH
command with the provided keys before starting the transaction.
-sourcepub fn hash_slot(&self) -> Option<u16>
Read the hash slot against which this transaction will run, if known.
-sourcepub fn cluster_node(&self) -> Option<Server>
Read the server ID against which this transaction will run, if known.
-Trait Implementations§
source§impl AclInterface for Transaction
Available on crate feature i-acl
only.
source§fn acl_setuser<S, V>(
+
sourcepub fn watch_before<K>(&self, keys: K)where
+ K: Into<MultipleKeys>,
👎Deprecated since 9.2.0: Please use WATCH
with clients from an ExclusivePool
instead.
Send the WATCH
command with the provided keys before starting the transaction.
+sourcepub fn hash_slot(&self) -> Option<u16>
Read the hash slot against which this transaction will run, if known.
+sourcepub fn cluster_node(&self) -> Option<Server>
Read the server ID against which this transaction will run, if known.
+Trait Implementations§
source§impl AclInterface for Transaction
Available on crate feature i-acl
only.
source§fn acl_setuser<S, V>(
&self,
username: S,
rules: V,
@@ -59,7 +61,7 @@
&self,
count: Option<u32>,
) -> impl Future<Output = RedisResult<R>>where
- R: FromRedis,
Read count
recent ACL security events. Read moresource§fn acl_log_reset(&self) -> impl Future<Output = RedisResult<()>>
Clear the ACL security events logs. Read moresource§impl AuthInterface for Transaction
Read count
recent ACL security events. Read moresource§fn acl_log_reset(&self) -> impl Future<Output = RedisResult<()>>
Clear the ACL security events logs. Read more
pub async fn exec<R>(&self, abort_on_error: bool) -> Result<R, RedisError>where
+Transaction in fred::clients - Rust Struct fred::clients::Transaction
source · pub struct Transaction { /* private fields */ }
Available on crate feature transactions
only.Expand description
A cheaply cloneable transaction block.
+Implementations§
source§impl Transaction
sourcepub fn pipeline(&self, val: bool)
Whether to pipeline commands in the transaction.
+Note: pipelined transactions should only be used with Redis version >=2.6.5.
+sourcepub fn watched_len(&self) -> usize
👎Deprecated since 9.2.0: Please use WATCH
with clients from an ExclusivePool
instead.
Read the number of keys to WATCH
before the starting the transaction.
+sourcepub async fn exec<R>(&self, abort_on_error: bool) -> Result<R, RedisError>where
R: FromRedis,
Executes all previously queued commands in a transaction.
If abort_on_error
is true
the client will automatically send DISCARD
if an error is received from
any of the commands prior to EXEC
. This does not apply to MOVED
or ASK
errors, which wll be followed
@@ -22,11 +24,11 @@
assert_eq!((foo, bar), (1, 2));
Ok(())
}
-sourcepub fn watch_before<K>(&self, keys: K)where
- K: Into<MultipleKeys>,
Send the WATCH
command with the provided keys before starting the transaction.
-sourcepub fn hash_slot(&self) -> Option<u16>
Read the hash slot against which this transaction will run, if known.
-sourcepub fn cluster_node(&self) -> Option<Server>
Read the server ID against which this transaction will run, if known.
-Trait Implementations§
source§impl AclInterface for Transaction
Available on crate feature i-acl
only.
source§fn acl_setuser<S, V>(
+
sourcepub fn watch_before<K>(&self, keys: K)where
+ K: Into<MultipleKeys>,
👎Deprecated since 9.2.0: Please use WATCH
with clients from an ExclusivePool
instead.
Send the WATCH
command with the provided keys before starting the transaction.
+sourcepub fn hash_slot(&self) -> Option<u16>
Read the hash slot against which this transaction will run, if known.
+sourcepub fn cluster_node(&self) -> Option<Server>
Read the server ID against which this transaction will run, if known.
+Trait Implementations§
source§impl AclInterface for Transaction
Available on crate feature i-acl
only.
source§fn acl_setuser<S, V>(
&self,
username: S,
rules: V,
@@ -59,7 +61,7 @@
&self,
count: Option<u32>,
) -> impl Future<Output = RedisResult<R>>where
- R: FromRedis,
Read count
recent ACL security events. Read moresource§fn acl_log_reset(&self) -> impl Future<Output = RedisResult<()>>
Clear the ACL security events logs. Read moresource§impl AuthInterface for Transaction
Read count
recent ACL security events. Read moresource§fn acl_log_reset(&self) -> impl Future<Output = RedisResult<()>>
Clear the ACL security events logs. Read more
Struct fred::clients::Transaction
source · pub struct Transaction { /* private fields */ }
transactions
only.Expand description
A cheaply cloneable transaction block.
+Implementations§
source§impl Transaction
impl Transaction
sourcepub fn pipeline(&self, val: bool)
pub fn pipeline(&self, val: bool)
Whether to pipeline commands in the transaction.
+Note: pipelined transactions should only be used with Redis version >=2.6.5.
+sourcepub fn watched_len(&self) -> usize
👎Deprecated since 9.2.0: Please use WATCH
with clients from an ExclusivePool
instead.
pub fn watched_len(&self) -> usize
WATCH
with clients from an ExclusivePool
instead.Read the number of keys to WATCH
before the starting the transaction.
sourcepub async fn exec<R>(&self, abort_on_error: bool) -> Result<R, RedisError>where
R: FromRedis,
pub async fn exec<R>(&self, abort_on_error: bool) -> Result<R, RedisError>where
R: FromRedis,
Executes all previously queued commands in a transaction.
If abort_on_error
is true
the client will automatically send DISCARD
if an error is received from
any of the commands prior to EXEC
. This does not apply to MOVED
or ASK
errors, which wll be followed
@@ -22,11 +24,11 @@
assert_eq!((foo, bar), (1, 2));
Ok(())
}
sourcepub fn watch_before<K>(&self, keys: K)where
- K: Into<MultipleKeys>,
pub fn watch_before<K>(&self, keys: K)where
- K: Into<MultipleKeys>,
Send the WATCH
command with the provided keys before starting the transaction.
sourcepub fn hash_slot(&self) -> Option<u16>
pub fn hash_slot(&self) -> Option<u16>
Read the hash slot against which this transaction will run, if known.
-sourcepub fn cluster_node(&self) -> Option<Server>
pub fn cluster_node(&self) -> Option<Server>
Read the server ID against which this transaction will run, if known.
-Trait Implementations§
source§impl AclInterface for Transaction
Available on crate feature i-acl
only.
impl AclInterface for Transaction
i-acl
only.source§fn acl_setuser<S, V>(
+
fn acl_setuser<S, V>( +
sourcepub fn watch_before<K>(&self, keys: K)where
+ K: Into<MultipleKeys>,
👎Deprecated since 9.2.0: Please use WATCH
with clients from an ExclusivePool
instead.
pub fn watch_before<K>(&self, keys: K)where
+ K: Into<MultipleKeys>,
WATCH
with clients from an ExclusivePool
instead.Send the WATCH
command with the provided keys before starting the transaction.
sourcepub fn hash_slot(&self) -> Option<u16>
pub fn hash_slot(&self) -> Option<u16>
Read the hash slot against which this transaction will run, if known.
+sourcepub fn cluster_node(&self) -> Option<Server>
pub fn cluster_node(&self) -> Option<Server>
Read the server ID against which this transaction will run, if known.
+source§impl AclInterface for Transaction
Available on crate feature i-acl
only.
impl AclInterface for Transaction
i-acl
only.source§fn acl_setuser<S, V>(
&self,
username: S,
rules: V,
@@ -59,7 +61,7 @@
&self,
count: Option<u32>,
) -> impl Future<Output = RedisResult<R>>where
- R: FromRedis,
fn acl_setuser<S, V>(
&self,
username: S,
rules: V,
@@ -59,7 +61,7 @@
&self,
count: Option<u32>,
) -> impl Future<Output = RedisResult<R>>where
- R: FromRedis,
count
recent ACL security events. Read moresource§fn acl_log_reset(&self) -> impl Future<Output = RedisResult<()>>
fn acl_log_reset(&self) -> impl Future<Output = RedisResult<()>>
source§impl AuthInterface for Transaction
impl AuthInterface for Transaction
count
recent ACL security events. Read moresource§fn acl_log_reset(&self) -> impl Future<Output = RedisResult<()>>
fn acl_log_reset(&self) -> impl Future<Output = RedisResult<()>>
source§impl AuthInterface for Transaction
impl AuthInterface for Transaction
source§impl ClientInterface for Transaction
Available on crate feature i-client
only.
impl ClientInterface for Transaction
i-client
only.source§fn client_id<R>(&self) -> impl Future<Output = RedisResult<R>>where
+) -> impl Future<Output = RedisResult<()>>Switch to a different protocol, optionally authenticating in the process. Read more
fn client_id<R>(&self) -> impl Future<Output = RedisResult<R>>where
+) -> impl Future<Output = RedisResult<()>>Switch to a different protocol, optionally authenticating in the process. Read more
source§impl ClientInterface for Transaction
Available on crate feature i-client
only.
impl ClientInterface for Transaction
i-client
only.source§fn client_id<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn client_id<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
source§fn connection_ids(&self) -> impl Future<Output = HashMap<Server, i64>>
fn connection_ids(&self) -> impl Future<Output = HashMap<Server, i64>>
source§fn client_info<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn client_info<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
source§fn client_kill<R>(
@@ -125,7 +127,7 @@
enabled: bool,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn client_kill<R>(
@@ -125,7 +127,7 @@
enabled: bool,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
i-tracking
only.source§impl ClientLike for Transaction
impl ClientLike for Transaction
source§fn client_config(&self) -> RedisConfig
fn client_config(&self) -> RedisConfig
source§fn client_reconnect_policy(&self) -> Option<ReconnectPolicy>
fn client_reconnect_policy(&self) -> Option<ReconnectPolicy>
source§fn connection_config(&self) -> &ConnectionConfig
fn connection_config(&self) -> &ConnectionConfig
source§fn protocol_version(&self) -> RespVersion
fn protocol_version(&self) -> RespVersion
source§fn has_reconnect_policy(&self) -> bool
fn has_reconnect_policy(&self) -> bool
source§fn is_pipelined(&self) -> bool
fn is_pipelined(&self) -> bool
source§fn is_clustered(&self) -> bool
fn is_clustered(&self) -> bool
source§fn uses_sentinels(&self) -> bool
fn uses_sentinels(&self) -> bool
source§fn update_perf_config(&self, config: PerformanceConfig)
fn update_perf_config(&self, config: PerformanceConfig)
source§fn perf_config(&self) -> PerformanceConfig
fn perf_config(&self) -> PerformanceConfig
source§fn state(&self) -> ClientState
fn state(&self) -> ClientState
source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
source§fn active_connections(
+enabled in OPTIN or OPTOUT mode. Read more
fn active_connections( +enabled in OPTIN or OPTOUT mode. Read more
source§impl ClientLike for Transaction
impl ClientLike for Transaction
source§fn client_config(&self) -> RedisConfig
fn client_config(&self) -> RedisConfig
source§fn client_reconnect_policy(&self) -> Option<ReconnectPolicy>
fn client_reconnect_policy(&self) -> Option<ReconnectPolicy>
source§fn connection_config(&self) -> &ConnectionConfig
fn connection_config(&self) -> &ConnectionConfig
source§fn protocol_version(&self) -> RespVersion
fn protocol_version(&self) -> RespVersion
source§fn has_reconnect_policy(&self) -> bool
fn has_reconnect_policy(&self) -> bool
source§fn is_pipelined(&self) -> bool
fn is_pipelined(&self) -> bool
source§fn is_clustered(&self) -> bool
fn is_clustered(&self) -> bool
source§fn uses_sentinels(&self) -> bool
fn uses_sentinels(&self) -> bool
source§fn update_perf_config(&self, config: PerformanceConfig)
fn update_perf_config(&self, config: PerformanceConfig)
source§fn perf_config(&self) -> PerformanceConfig
fn perf_config(&self) -> PerformanceConfig
source§fn state(&self) -> ClientState
fn state(&self) -> ClientState
source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
source§fn active_connections(
&self,
) -> impl Future<Output = Result<Vec<Server>, RedisError>>
fn active_connections( &self, ) -> impl Future<Output = Result<Vec<Server>, RedisError>>
source§fn server_version(&self) -> Option<Version>
fn server_version(&self) -> Option<Version>
source§fn set_resolver(&self, resolver: Rc<dyn Resolve>) -> impl Future
fn set_resolver(&self, resolver: Rc<dyn Resolve>) -> impl Future
dns
only.source§fn connect(&self) -> ConnectHandle
fn connect(&self) -> ConnectHandle
source§fn force_reconnection(&self) -> impl Future<Output = RedisResult<()>>
fn force_reconnection(&self) -> impl Future<Output = RedisResult<()>>
source§fn wait_for_connect(&self) -> impl Future<Output = RedisResult<()>>
fn wait_for_connect(&self) -> impl Future<Output = RedisResult<()>>
source§fn init(&self) -> impl Future<Output = RedisResult<ConnectHandle>>
fn init(&self) -> impl Future<Output = RedisResult<ConnectHandle>>
source§fn quit(&self) -> impl Future<Output = RedisResult<()>>
fn quit(&self) -> impl Future<Output = RedisResult<()>>
source§fn with_options(&self, options: &Options) -> WithOptions<Self>
fn with_options(&self, options: &Options) -> WithOptions<Self>
source§impl Clone for Transaction
impl Clone for Transaction
source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl ConfigInterface for Transaction
Available on crate feature i-config
only.
impl ConfigInterface for Transaction
i-config
only.source§fn config_resetstat(&self) -> impl Future<Output = RedisResult<()>>
fn config_resetstat(&self) -> impl Future<Output = RedisResult<()>>
source§fn config_rewrite(&self) -> impl Future<Output = RedisResult<()>>
fn config_rewrite(&self) -> impl Future<Output = RedisResult<()>>
source§fn with_options(&self, options: &Options) -> WithOptions<Self>
fn with_options(&self, options: &Options) -> WithOptions<Self>
source§impl Clone for Transaction
impl Clone for Transaction
source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl ConfigInterface for Transaction
Available on crate feature i-config
only.
impl ConfigInterface for Transaction
i-config
only.source§fn config_resetstat(&self) -> impl Future<Output = RedisResult<()>>
fn config_resetstat(&self) -> impl Future<Output = RedisResult<()>>
source§fn config_rewrite(&self) -> impl Future<Output = RedisResult<()>>
fn config_rewrite(&self) -> impl Future<Output = RedisResult<()>>
source§fn config_get<R, S>(&self, parameter: S) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
@@ -165,7 +167,7 @@
) -> impl Future<Output = RedisResult<()>>The CONFIG SET command is used in order to reconfigure the server at run time without the need to restart Redis. Read more
fn config_get<R, S>(&self, parameter: S) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
@@ -165,7 +167,7 @@
) -> impl Future<Output = RedisResult<()>>The CONFIG SET command is used in order to reconfigure the server at run time without the need to restart Redis. Read more
source§impl Debug for Transaction
impl Debug for Transaction
source§impl FunctionInterface for Transaction
Available on crate feature i-scripts
only.
impl FunctionInterface for Transaction
i-scripts
only.source§impl Debug for Transaction
impl Debug for Transaction
source§impl FunctionInterface for Transaction
Available on crate feature i-scripts
only.
impl FunctionInterface for Transaction
i-scripts
only.source§fn function_stats<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn function_stats<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
source§impl GeoInterface for Transaction
Available on crate feature i-geo
only.
impl GeoInterface for Transaction
i-geo
only.source§impl GeoInterface for Transaction
Available on crate feature i-geo
only.
impl GeoInterface for Transaction
i-geo
only.source§impl HashesInterface for Transaction
Available on crate feature i-hashes
only.
impl HashesInterface for Transaction
i-hashes
only.source§impl HashesInterface for Transaction
Available on crate feature i-hashes
only.
impl HashesInterface for Transaction
i-hashes
only.