pub struct TransactionManager { /* private fields */ }Expand description
Transaction manager exposing MULTI/EXEC/WATCH/DISCARD
Implementations§
Source§impl TransactionManager
impl TransactionManager
Sourcepub async fn multi(
&self,
options: TransactionOptions,
) -> Result<TransactionResponse>
pub async fn multi( &self, options: TransactionOptions, ) -> Result<TransactionResponse>
Start a transaction (MULTI)
Sourcepub async fn discard(
&self,
options: TransactionOptions,
) -> Result<TransactionResponse>
pub async fn discard( &self, options: TransactionOptions, ) -> Result<TransactionResponse>
Discard an active transaction (DISCARD)
Sourcepub async fn watch(
&self,
keys: &[impl AsRef<str>],
options: TransactionOptions,
) -> Result<TransactionResponse>
pub async fn watch( &self, keys: &[impl AsRef<str>], options: TransactionOptions, ) -> Result<TransactionResponse>
Watch keys for optimistic locking (WATCH)
Sourcepub async fn unwatch(
&self,
options: TransactionOptions,
) -> Result<TransactionResponse>
pub async fn unwatch( &self, options: TransactionOptions, ) -> Result<TransactionResponse>
Remove all watched keys (UNWATCH)
Sourcepub async fn exec(
&self,
options: TransactionOptions,
) -> Result<TransactionExecResult>
pub async fn exec( &self, options: TransactionOptions, ) -> Result<TransactionExecResult>
Execute queued commands (EXEC)
Sourcepub fn command_client(
&self,
client_id: impl Into<String>,
) -> TransactionCommandClient
pub fn command_client( &self, client_id: impl Into<String>, ) -> TransactionCommandClient
Create a helper client that automatically injects client_id for raw commands
Trait Implementations§
Source§impl Clone for TransactionManager
impl Clone for TransactionManager
Source§fn clone(&self) -> TransactionManager
fn clone(&self) -> TransactionManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TransactionManager
impl !RefUnwindSafe for TransactionManager
impl Send for TransactionManager
impl Sync for TransactionManager
impl Unpin for TransactionManager
impl UnsafeUnpin for TransactionManager
impl !UnwindSafe for TransactionManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more