pub struct Lock {
pub owner: String,
pub nonce: String,
pub expires_unix_ms: u64,
pub resource: String,
}Expand description
A lease-based lock on a resource
Fields§
§owner: StringActor ID who owns the lock (hex-encoded)
nonce: StringUnique nonce for this lock instance
expires_unix_ms: u64When the lock expires (Unix timestamp in ms)
resource: StringResource being locked (e.g., “repo:global”, “issue:abc123”)
Implementations§
Source§impl Lock
impl Lock
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if the lock has expired
Sourcepub fn time_remaining_ms(&self) -> u64
pub fn time_remaining_ms(&self) -> u64
Get time remaining in milliseconds (0 if expired)
Sourcepub fn conflicts_with(&self, other_resource: &str) -> bool
pub fn conflicts_with(&self, other_resource: &str) -> bool
Check if this lock conflicts with another resource
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Lock
impl<'de> Deserialize<'de> for Lock
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Lock
impl StructuralPartialEq for Lock
Auto Trait Implementations§
impl Freeze for Lock
impl RefUnwindSafe for Lock
impl Send for Lock
impl Sync for Lock
impl Unpin for Lock
impl UnwindSafe for Lock
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.