pub struct AsLockWriteGuard<'w, T> { /* private fields */ }Expand description
Guard used for updating the tables.
Implementations§
Source§impl<'w, T> AsLockWriteGuard<'w, T>
impl<'w, T> AsLockWriteGuard<'w, T>
Sourcepub 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.
Users should never use the return value to directly mutate the tables, since this will lead to them going out of sync.
The update passed in must be valid for ’static because it will outlive the AsLockWriteGuard taking the update, so we can’t make any limitations on it.
Sourcepub fn update_tables_closure<R>(
&mut self,
update: impl Fn(&mut T) -> R + 'static + Sized + Send,
) -> R
pub fn update_tables_closure<R>( &mut self, update: impl Fn(&mut T) -> R + 'static + Sized + Send, ) -> R
Like update_tables but allows the user to pass a closure for
convenience. Only allows return values that own their data.
TODO: Consider allowing return values that have lifetimes, this should likely be as safe as the explicit UpdateTables trait.
Trait Implementations§
Source§impl<'w, T: Debug> Debug for AsLockWriteGuard<'w, T>
impl<'w, T: Debug> Debug for AsLockWriteGuard<'w, T>
Source§impl<'w, T> Deref for AsLockWriteGuard<'w, T>
impl<'w, T> Deref for AsLockWriteGuard<'w, T>
Auto Trait Implementations§
impl<'w, T> Freeze for AsLockWriteGuard<'w, T>
impl<'w, T> !RefUnwindSafe for AsLockWriteGuard<'w, T>
impl<'w, T> !Send for AsLockWriteGuard<'w, T>
impl<'w, T> !Sync for AsLockWriteGuard<'w, T>
impl<'w, T> Unpin for AsLockWriteGuard<'w, T>
impl<'w, T> !UnwindSafe for AsLockWriteGuard<'w, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more