pub struct SharedReducer<'a, G, L = G, F: Fn(&mut G, &L) = fn(&mut G, &L)> { /* private fields */ }Expand description
A shareable copy of a Reducer containing a local value and implementing
Clone.
The local value can be accessed with AsRef and AsMut
implementations.
When a SharedReducer is dropped, the local value will be reduced into
the global value. If the mutex is poisoned (e.g., due to a panic in another
thread), the reduction will still be performed on the recovered value.
Implementations§
Sourcepub fn peek(&self) -> G
pub fn peek(&self) -> G
Returns the current global value.
This method delegates to Reducer::peek.
Trait Implementations§
Auto Trait Implementations§
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