zebra_network/peer_set/inventory_registry/
update.rs
1use std::pin::Pin;
4
5use futures::{
6 future::Future,
7 task::{Context, Poll},
8};
9
10use crate::{peer_set::InventoryRegistry, BoxError};
11
12#[derive(Debug)]
14#[must_use = "futures do nothing unless you `.await` or poll them"]
15pub struct Update<'a> {
16 registry: &'a mut InventoryRegistry,
17}
18
19impl Unpin for Update<'_> {}
20
21impl<'a> Update<'a> {
22 pub fn new(registry: &'a mut InventoryRegistry) -> Self {
27 Self { registry }
28 }
29}
30
31impl Future for Update<'_> {
32 type Output = Result<(), BoxError>;
33
34 fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
38 self.registry.poll_inventory(cx)
39 }
40}