Struct active_standby::primitives::shared::WriteGuard [−][src]
pub struct WriteGuard<'w, T> { /* fields omitted */ }
Expand description
Guard used for updating the tables.
Implementations
pub fn update_tables<'a, R>(
&'a mut self,
update: impl UpdateTables<'a, T, R> + 'static + Sized + Send
) -> R
pub fn update_tables<'a, R>(
&'a mut self,
update: impl UpdateTables<'a, T, R> + 'static + Sized + Send
) -> R
Takes an update which will change the state of the underlying data. This is done through the interface of UpdateTables.
The return value can be anything that owns it’s own data. We don’t allow the return value to be a reference to the data as a way to encourage keeping the tables in sync. Since returning a &mut would allow users to cause mutations outside of the update they pass.
The update passed in must be valid for ’static because it will outlive the WriteGuard taking the update, so we can’t make any limitations on it.
Trait Implementations
Dereferencing the WriteGuard will let you see the state of the standby table. If you want to inspect the state of the active_table you must go through a Reader.