Struct rw_cell::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 get_writer(&self) -> CellWriter<T>
pub fn get_writer(&self) -> CellWriter<T>
Return CellWriter for write data in cell
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 (w, mut r) = rw_cell::cell("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));
}