Struct dirty::Dirty
[−]
[src]
pub struct Dirty<T> { /* fields omitted */ }
Dirty wraps a value of type T with functions similiar to that of a Read/Write lock but simply sets a dirty flag on write(), reset on read()
Methods
impl<T> Dirty<T>
[src]
fn new(val: T) -> Dirty<T>
Create a new Dirty
fn dirty(&self) -> bool
Returns true if dirty, false otherwise
fn write(&mut self) -> &mut T
Writable value return, sets the dirty flag
fn read(&mut self) -> &T
Read the value and clear the dirty flag if set
fn read_dirty(&mut self) -> Option<&T>
Read the value only if modified since last read, clears the dirty flag