Struct cybergrape::update_accumulator::UpdateAccumulator
source · pub struct UpdateAccumulator<Hdm>where
Hdm: HardwareDataManager,{
hdm_handle: Arc<Mutex<Hdm>>,
accumulated_updates: HashMap<(Id, Id), VecDeque<Update>>,
}
Expand description
The UpdateAccumulator
consumes updates from a HardwareDataManager
, and
accumulates them. It can be queried for the most recent updates using get_status
.
Fields§
§hdm_handle: Arc<Mutex<Hdm>>
A handle to communicate with the [Hdm
]
accumulated_updates: HashMap<(Id, Id), VecDeque<Update>>
A HashMap mapping (Id, Id)
pairs to Update
s.
Implementations§
source§impl<Hdm> UpdateAccumulator<Hdm>where
Hdm: HardwareDataManager,
impl<Hdm> UpdateAccumulator<Hdm>where
Hdm: HardwareDataManager,
sourcepub fn new(hdm_handle: Arc<Mutex<Hdm>>) -> Self
pub fn new(hdm_handle: Arc<Mutex<Hdm>>) -> Self
Instantiates a new UpdateAccumulator
attached to a [Hdm
]
sourcepub fn get_status(&mut self) -> Vec<Update>
pub fn get_status(&mut self) -> Vec<Update>
Returns a vec contatining the most recent Update
s for all pairs
of blocks. Essentially, the most updated data available.
Trait Implementations§
Auto Trait Implementations§
impl<Hdm> Freeze for UpdateAccumulator<Hdm>
impl<Hdm> RefUnwindSafe for UpdateAccumulator<Hdm>
impl<Hdm> Send for UpdateAccumulator<Hdm>where
Hdm: Send,
impl<Hdm> Sync for UpdateAccumulator<Hdm>where
Hdm: Send,
impl<Hdm> Unpin for UpdateAccumulator<Hdm>
impl<Hdm> UnwindSafe for UpdateAccumulator<Hdm>
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more