pub struct Armc<T: ?Sized> { /* private fields */ }
Implementations§
source§impl<T: ?Sized> Armc<T>
impl<T: ?Sized> Armc<T>
sourcepub fn lock(&self) -> ArmcGuard<'_, T>
pub fn lock(&self) -> ArmcGuard<'_, T>
Returns a token([ArmcGuard<’_,T>]) for data to be securely modified.
Examples
use armc::Armc;
let armc = Armc::new(5);
assert_eq!(*armc.lock(),5);
sourcepub fn lock_ref(&self) -> ArmcRefGuard<'_, T>
pub fn lock_ref(&self) -> ArmcRefGuard<'_, T>
Returns a token([ArmcRefGuard<’_,T>]) to block any thread that tries to modify the data, guaranteeing its integrity for asynchronous reading.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Armc<T>
impl<T: ?Sized> Send for Armc<T>where T: Send,
impl<T: ?Sized> Sync for Armc<T>where T: Send,
impl<T: ?Sized> Unpin for Armc<T>
impl<T> !UnwindSafe for Armc<T>
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