Struct simple_left_right::Writer
source · pub struct Writer<T, O> { /* private fields */ }Expand description
Not realtime safe Object which can change the internal T value
Implementations§
source§impl<T: Absorb<O>, O> Writer<T, O>
impl<T: Absorb<O>, O> Writer<T, O>
sourcepub fn lock(&mut self) -> WriteGuard<'_, T, O>
pub fn lock(&mut self) -> WriteGuard<'_, T, O>
Blocks if the Reader has a ReadGuard pointing to the old value.
Uses a Spinlock because for anything else the OS needs to be involved. Reader can’t talk to the OS.
sourcepub fn try_lock(&mut self) -> Option<WriteGuard<'_, T, O>>
pub fn try_lock(&mut self) -> Option<WriteGuard<'_, T, O>>
doesn’t block. Returns None if the Reader has a ReadGuard pointing to the old value
Trait Implementations§
Auto Trait Implementations§
impl<T, O> Freeze for Writer<T, O>
impl<T, O> !RefUnwindSafe for Writer<T, O>
impl<T, O> Send for Writer<T, O>
impl<T, O> Sync for Writer<T, O>
impl<T, O> Unpin for Writer<T, O>where
O: Unpin,
impl<T, O> !UnwindSafe for Writer<T, O>
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