Struct rw_cell::swmr::CellReader
source · pub struct CellReader<T> { /* private fields */ }Expand description
Struct for read data from cell with non-copy and non-lock
Implementations§
source§impl<T> CellReader<T>
impl<T> CellReader<T>
sourcepub fn read_with_is_new(&mut self) -> (&T, bool)
pub fn read_with_is_new(&mut self) -> (&T, bool)
Return tuple value and bool value is new or no
Examples
fn main() {
let mut d = rw_cell::swmr::CellDistributor::new("Not good, but ok");
let mut r = d.get_reader();
assert_eq!(r.read_with_is_new(), (&"Not good, but ok", false));
d.write("Not good");
assert_eq!(r.read_with_is_new(), (&"Not good", true));
}