1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use crate::{gossip::packed_event::PackedEvent, id::PublicId, network_event::NetworkEvent};
#[serde(bound = "")]
#[derive(Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Debug)]
pub struct Request<T: NetworkEvent, P: PublicId> {
pub(crate) packed_events: Vec<PackedEvent<T, P>>,
}
impl<T: NetworkEvent, P: PublicId> Request<T, P> {
pub(crate) fn new(packed_events: Vec<PackedEvent<T, P>>) -> Self {
Self { packed_events }
}
}
#[serde(bound = "")]
#[derive(Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Debug)]
pub struct Response<T: NetworkEvent, P: PublicId> {
pub(crate) packed_events: Vec<PackedEvent<T, P>>,
}
impl<T: NetworkEvent, P: PublicId> Response<T, P> {
pub(crate) fn new(packed_events: Vec<PackedEvent<T, P>>) -> Self {
Self { packed_events }
}
}