pub struct SimpleLock<T: ?Sized> { /* private fields */ }
Expand description
A simple lock.
Intentionally to not providing the lock
, you can spin loop try_lock
if you want.
You should use Mutex
if you need blocking lock.
Implementations§
Source§impl<T> SimpleLock<T>
impl<T> SimpleLock<T>
Sourcepub fn new(value: T) -> SimpleLock<T>
pub fn new(value: T) -> SimpleLock<T>
Returns a new SimpleLock initialized with value
.
Trait Implementations§
Source§impl<T: ?Sized + Default> Default for SimpleLock<T>
impl<T: ?Sized + Default> Default for SimpleLock<T>
Source§fn default() -> SimpleLock<T>
fn default() -> SimpleLock<T>
Returns the “default value” for a type. Read more
Source§impl<T> From<T> for SimpleLock<T>
impl<T> From<T> for SimpleLock<T>
impl<T: ?Sized + Send> Send for SimpleLock<T>
impl<T: ?Sized + Send> Sync for SimpleLock<T>
Auto Trait Implementations§
impl<T> !Freeze for SimpleLock<T>
impl<T> !RefUnwindSafe for SimpleLock<T>
impl<T> Unpin for SimpleLock<T>
impl<T> UnwindSafe for SimpleLock<T>where
T: UnwindSafe + ?Sized,
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