Struct ralf::State
[−]
[src]
pub struct State<T> where
T: Copy + Clone, { /* fields omitted */ }
State
is a wrapper around your state, allowing querying and modification
Methods
impl<T> State<T> where
T: Copy + Clone,
[src]
T: Copy + Clone,
pub fn new(initial_state: &T) -> State<T>
[src]
Create a new state from an initial value
pub fn get_state(&self) -> T
[src]
return a clone of the underlying data
pub fn set_state(&self, new_state: &T)
[src]
Edit the underlying data immmutably