aboutsummaryrefslogtreecommitdiff
path: root/p2p/src/protocol.rs
diff options
context:
space:
mode:
authorhozan23 <hozan23@karyontech.net>2024-06-27 03:52:18 +0200
committerhozan23 <hozan23@karyontech.net>2024-06-27 23:32:10 +0200
commitbcc6721257889f85f57af1b40351540585ffd41d (patch)
tree915adea7454fa91eafadfd9e7f9834a7cd0d9ebc /p2p/src/protocol.rs
parent7e4e25d9fbac403b0d46e8081baf00fb3865d56d (diff)
Remove redundant type aliases
Diffstat (limited to 'p2p/src/protocol.rs')
-rw-r--r--p2p/src/protocol.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/p2p/src/protocol.rs b/p2p/src/protocol.rs
index d42f092..021844f 100644
--- a/p2p/src/protocol.rs
+++ b/p2p/src/protocol.rs
@@ -4,11 +4,9 @@ use async_trait::async_trait;
use karyon_core::event::EventValue;
-use crate::{peer::ArcPeer, version::Version, Result};
+use crate::{peer::Peer, version::Version, Result};
-pub type ArcProtocol = Arc<dyn Protocol>;
-
-pub type ProtocolConstructor = dyn Fn(ArcPeer) -> Arc<dyn Protocol> + Send + Sync;
+pub type ProtocolConstructor = dyn Fn(Arc<Peer>) -> Arc<dyn Protocol> + Send + Sync;
pub type ProtocolID = String;
@@ -38,17 +36,17 @@ impl EventValue for ProtocolEvent {
/// use smol::Executor;
///
/// use karyon_p2p::{
-/// protocol::{ArcProtocol, Protocol, ProtocolID, ProtocolEvent},
-/// Backend, PeerID, Config, Version, Error, ArcPeer,
+/// protocol::{Protocol, ProtocolID, ProtocolEvent},
+/// Backend, PeerID, Config, Version, Error, Peer,
/// keypair::{KeyPair, KeyPairType},
/// };
///
/// pub struct NewProtocol {
-/// peer: ArcPeer,
+/// peer: Arc<Peer>,
/// }
///
/// impl NewProtocol {
-/// fn new(peer: ArcPeer) -> ArcProtocol {
+/// fn new(peer: Arc<Peer>) -> Arc<dyn Protocol> {
/// Arc::new(Self {
/// peer,
/// })