Struct etcd_client::LockClient [−][src]
#[repr(transparent)]pub struct LockClient { /* fields omitted */ }
Client for Lock operations.
Implementations
impl LockClient
[src]
impl LockClient
[src]pub async fn lock(
&mut self,
name: impl Into<Vec<u8>>,
options: Option<LockOptions>
) -> Result<LockResponse, Error>
[src]
&mut self,
name: impl Into<Vec<u8>>,
options: Option<LockOptions>
) -> Result<LockResponse, Error>
Acquires a distributed shared lock on a given named lock. On success, it will return a unique key that exists so long as the lock is held by the caller. This key can be used in conjunction with transactions to safely ensure updates to etcd only occur while holding lock ownership. The lock is held until Unlock is called on the key or the lease associate with the owner expires.
pub async fn unlock(
&mut self,
key: impl Into<Vec<u8>>
) -> Result<UnlockResponse, Error>
[src]
&mut self,
key: impl Into<Vec<u8>>
) -> Result<UnlockResponse, Error>
Takes a key returned by Lock and releases the hold on lock. The next Lock caller waiting for the lock will then be woken up and given ownership of the lock.
Trait Implementations
impl Clone for LockClient
[src]
impl Clone for LockClient
[src]fn clone(&self) -> LockClient
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl !RefUnwindSafe for LockClient
impl !RefUnwindSafe for LockClient
impl Send for LockClient
impl Send for LockClient
impl Sync for LockClient
impl Sync for LockClient
impl Unpin for LockClient
impl Unpin for LockClient
impl !UnwindSafe for LockClient
impl !UnwindSafe for LockClient
Blanket Implementations
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> IntoRequest<T> for T
[src]
impl<T> IntoRequest<T> for T
[src]pub fn into_request(self) -> Request<T>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
impl<T> WithSubscriber for T
[src]pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,