pub struct LockHandle {
pub key: String,
pub lock_id: String,
pub ttl_ms: u64,
}Expand description
Handle returned by a successful LockingPlugin::try_lock.
The handle is opaque to callers — they pass it back to
LockingPlugin::renew and LockingPlugin::release unchanged. The
plugin uses the embedded lock_id token to detect stale operations
(see module docs).
Fields§
§key: StringThe key the lock was acquired on. Matches the key argument
passed to LockingPlugin::try_lock. Useful for logging and
metrics; the plugin also needs it on release / renew.
lock_id: StringRandom token minted by the plugin at acquisition time. Backends use it to implement check-and-set release so a stale caller cannot release a lock it no longer owns. Format is plugin-defined (UUIDv4 is typical) and callers must treat it as opaque.
ttl_ms: u64The TTL the lock was acquired with, in milliseconds. Stored on
the handle so renew can re-apply the same TTL without the
caller having to remember it.
Trait Implementations§
Source§impl Clone for LockHandle
impl Clone for LockHandle
Source§fn clone(&self) -> LockHandle
fn clone(&self) -> LockHandle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more