pub struct Lock<'a> {
pub session_id: String,
pub key: String,
pub timeout: Duration,
pub namespace: String,
pub datacenter: String,
pub value: Option<Vec<u8>>,
pub consul: &'a Consul,
}Expand description
Represents a lock against Consul. The lifetime of this object defines the validity of the lock against consul. When the object is dropped, the lock is attempted to be released for the next consumer.
Fields§
§session_id: StringThe session ID of the lock.
key: StringThe key for the lock.
timeout: DurationThe timeout of the session and the lock.
namespace: StringThe namespace this lock exists in.
datacenter: StringThe datacenter of this lock.
value: Option<Vec<u8>>The data in this lock’s key
consul: &'a ConsulThe consul client this lock was acquired using.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Lock<'a>
impl<'a> !RefUnwindSafe for Lock<'a>
impl<'a> Send for Lock<'a>
impl<'a> Sync for Lock<'a>
impl<'a> Unpin for Lock<'a>
impl<'a> !UnwindSafe for Lock<'a>
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