pub struct TimeLock {
pub expiry: SystemTime,
pub expired: bool,
}Expand description
A struct that represents a time-based lock mechanism, which tracks an expiration time and provides functionality to check if the lock has expired.
Fields§
§expiry: SystemTime§expired: boolImplementations§
Source§impl TimeLock
impl TimeLock
Sourcepub fn is_expired(&mut self) -> bool
pub fn is_expired(&mut self) -> bool
Checks if the TimeLock has expired by comparing the current system time with the expiration time.
Once the lock has expired, it will set the expired flag to true and return the result.
§Returns
trueif the lock has expired,falseotherwise.
Auto Trait Implementations§
impl Freeze for TimeLock
impl RefUnwindSafe for TimeLock
impl Send for TimeLock
impl Sync for TimeLock
impl Unpin for TimeLock
impl UnwindSafe for TimeLock
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more