diff --git a/crates/papyrus_network/src/lib.rs b/crates/papyrus_network/src/lib.rs index 7774cc2d0e..9e93ce6a3b 100644 --- a/crates/papyrus_network/src/lib.rs +++ b/crates/papyrus_network/src/lib.rs @@ -75,6 +75,7 @@ impl From for Protocol { } } +/// This struct represents a query that can be sent to a peer. #[derive(Default, Debug, PartialEq, Eq)] pub struct Query { pub start_block: BlockNumber, @@ -140,11 +141,16 @@ pub enum BlockHashOrNumber { pub type SignedBlockHeaderStream = Pin> + Send>>; pub type StateDiffStream = Pin> + Send>>; +/// This struct represents the receiver end of the response streams for a network subscriber. +/// It is created by the network manager and passed to the subscriber when calling +/// register_subscriber. pub struct ResponseReceivers { pub signed_headers_receiver: Option, pub state_diffs_receiver: Option, } +/// This is a part of the exposed API of the network manager. +/// This is meant to represent the different underlying p2p protocols the network manager supports. #[derive(Debug, PartialEq, Eq, Clone, Copy, Hash, Sequence)] pub enum Protocol { SignedBlockHeader,