From d4c8251ea3c4f6e809bb19f8faa907083316f483 Mon Sep 17 00:00:00 2001 From: hozan23 Date: Wed, 22 Nov 2023 21:48:09 +0300 Subject: add Docs section to README.md file & add an example to p2p crate --- p2p/src/backend.rs | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'p2p/src/backend.rs') diff --git a/p2p/src/backend.rs b/p2p/src/backend.rs index bb0d891..4410205 100644 --- a/p2p/src/backend.rs +++ b/p2p/src/backend.rs @@ -20,40 +20,6 @@ pub type ArcBackend = Arc; /// the P2P network. /// /// -/// # Example -/// ``` -/// use std::sync::Arc; -/// -/// use easy_parallel::Parallel; -/// use smol::{channel as smol_channel, future, Executor}; -/// -/// use karyons_p2p::{Backend, Config, PeerID}; -/// -/// let peer_id = PeerID::random(); -/// -/// // Create the configuration for the backend. -/// let mut config = Config::default(); -/// -/// -/// // Create a new Executor -/// let ex = Arc::new(Executor::new()); -/// -/// // Create a new Backend -/// let backend = Backend::new(peer_id, config, ex.clone()); -/// -/// let task = async { -/// // Run the backend -/// backend.run().await.unwrap(); -/// -/// // .... -/// -/// // Shutdown the backend -/// backend.shutdown().await; -/// }; -/// -/// future::block_on(ex.run(task)); -/// -/// ``` pub struct Backend { /// The Configuration for the P2P network. config: Arc, -- cgit v1.2.3