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 tx = rw_cell::broadcast::Writer::new("Not good, but ok");
let mut rx = tx.subscribe();
assert_eq!(rx.read_with_is_new(), (&"Not good, but ok", false));
tx.share("Not good");
assert_eq!(rx.read_with_is_new(), (&"Not good", 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