pub struct TIME { /* private fields */ }Expand description
TIME allows to access the uptime of the kernel.
Methods from Deref<Target = Mutex<StaticTimeManager>>§
Sourcepub fn lock(&self) -> MutexGuard<'_, T>
pub fn lock(&self) -> MutexGuard<'_, T>
Locks the Mutex and returns a guard that permits access to the inner data.
The returned value may be dereferenced for data access and the lock will be dropped when the guard falls out of scope.
let lock = spin::Mutex::new(0);
{
let mut data = lock.lock();
// The lock is now locked and the data can be accessed
*data += 1;
// The lock is implicitly dropped at the end of the scope
}Sourcepub fn is_locked(&self) -> bool
pub fn is_locked(&self) -> bool
Returns true if the lock is currently held.
§Safety
This function provides no synchronization guarantees and so its result should be considered ‘out of date’ the instant it is called. Do not use it for synchronization purposes. However, it may be useful as a heuristic.
Sourcepub unsafe fn force_unlock(&self)
pub unsafe fn force_unlock(&self)
Sourcepub fn try_lock(&self) -> Option<MutexGuard<'_, T>>
pub fn try_lock(&self) -> Option<MutexGuard<'_, T>>
Trait Implementations§
Source§impl Deref for TIME
impl Deref for TIME
Source§type Target = Mutex<StaticTimeManager>
type Target = Mutex<StaticTimeManager>
The resulting type after dereferencing.
Source§fn deref(&self) -> &Mutex<StaticTimeManager>
fn deref(&self) -> &Mutex<StaticTimeManager>
Dereferences the value.
impl LazyStatic for TIME
Auto Trait Implementations§
impl Freeze for TIME
impl RefUnwindSafe for TIME
impl Send for TIME
impl Sync for TIME
impl Unpin for TIME
impl UnsafeUnpin for TIME
impl UnwindSafe for TIME
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