pub struct Reader<T> { /* private fields */ }Expand description
Struct for read data from cell with non-copy and non-lock
Implementations§
Source§impl<T> Reader<T>
impl<T> Reader<T>
Sourcepub fn read_with_is_new(&mut self) -> (&T, bool)
pub fn read_with_is_new(&mut self) -> (&T, bool)
Returns a tuple of value references and a boolean value, whether new or not
§Examples
let (mut w, mut r) = rw_cell::bridge::new("Not good");
assert_eq!(r.read_with_is_new(), (&"Not good", false));
w.write("But ok");
assert_eq!(r.read_with_is_new(), (&"But ok", true));Auto Trait Implementations§
impl<T> Freeze for Reader<T>
impl<T> RefUnwindSafe for Reader<T>where
T: RefUnwindSafe,
impl<T> Send for Reader<T>
impl<T> Sync for Reader<T>
impl<T> Unpin for Reader<T>
impl<T> UnwindSafe for Reader<T>where
T: RefUnwindSafe,
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