aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhozan23 <hozan23@proton.me>2023-11-23 00:08:16 +0300
committerhozan23 <hozan23@proton.me>2023-11-23 00:08:16 +0300
commitf1b78d53d7d0009fdef8f0e220bc0c421288c514 (patch)
tree4e00a6ef8228a25debcaadf8b1e3b5ca4517eeae
parent52616ee63d77e1847f502c0ac92bead6eaa12ab3 (diff)
general clean ups for the docs
-rw-r--r--core/src/async_utils/select.rs2
-rw-r--r--core/src/event.rs6
-rw-r--r--core/src/lib.rs7
-rw-r--r--jsonrpc/src/server.rs2
-rw-r--r--jsonrpc/src/service.rs2
-rw-r--r--net/src/connection.rs6
-rw-r--r--net/src/transports/tcp.rs2
-rw-r--r--net/src/transports/udp.rs2
-rw-r--r--net/src/transports/unix.rs2
-rw-r--r--p2p/src/backend.rs2
-rw-r--r--p2p/src/routing_table/mod.rs2
11 files changed, 17 insertions, 18 deletions
diff --git a/core/src/async_utils/select.rs b/core/src/async_utils/select.rs
index d61b355..9fe3c77 100644
--- a/core/src/async_utils/select.rs
+++ b/core/src/async_utils/select.rs
@@ -42,7 +42,7 @@ pin_project! {
}
}
-/// The return value from the `select` function, indicating which future
+/// The return value from the [`select`] function, indicating which future
/// completed first.
#[derive(Debug)]
pub enum Either<T1, T2> {
diff --git a/core/src/event.rs b/core/src/event.rs
index b856385..0503e88 100644
--- a/core/src/event.rs
+++ b/core/src/event.rs
@@ -169,7 +169,7 @@ where
listener
}
- /// Removes an event listener attached to the given topic.
+ /// Removes the event listener attached to the given topic.
async fn remove(&self, topic: &T, event_id: &str, listener_id: &EventListenerID) {
let topics = &mut self.listeners.lock().await;
if !topics.contains_key(topic) {
@@ -190,7 +190,7 @@ where
}
}
-/// EventListener listens for and receives events from the `EventSys`.
+/// EventListener listens for and receives events from the [`EventSys`].
pub struct EventListener<T, E> {
id: EventListenerID,
recv_chan: Receiver<Event>,
@@ -260,7 +260,7 @@ where
}
}
-/// An event within the `EventSys`.
+/// An event within the [`EventSys`].
#[derive(Clone, Debug)]
pub struct Event {
/// The time at which the event was created.
diff --git a/core/src/lib.rs b/core/src/lib.rs
index fef7459..6c40909 100644
--- a/core/src/lib.rs
+++ b/core/src/lib.rs
@@ -1,16 +1,17 @@
/// A set of helper tools and functions.
pub mod utils;
-/// A module containing async utilities that work with the `smol` async runtime.
+/// A module containing async utilities that work with the
+/// [`smol`](https://github.com/smol-rs/smol) async runtime.
pub mod async_utils;
/// Represents karyons's Core Error.
pub mod error;
-/// [`EventSys`](./event/struct.EventSys.html) Implementation
+/// [`event::EventSys`] Implementation
pub mod event;
-/// A simple publish-subscribe system.[`Read More`](./pubsub/struct.Publisher.html)
+/// A simple publish-subscribe system [`Read More`](./pubsub/struct.Publisher.html)
pub mod pubsub;
use smol::Executor as SmolEx;
diff --git a/jsonrpc/src/server.rs b/jsonrpc/src/server.rs
index f6006cc..213fa41 100644
--- a/jsonrpc/src/server.rs
+++ b/jsonrpc/src/server.rs
@@ -16,7 +16,7 @@ use crate::{
Error, Result, JSONRPC_VERSION,
};
-/// Represents an RPC server
+/// RPC server config
#[derive(Default)]
pub struct ServerConfig {
codec_config: CodecConfig,
diff --git a/jsonrpc/src/service.rs b/jsonrpc/src/service.rs
index f0e2828..62ec726 100644
--- a/jsonrpc/src/service.rs
+++ b/jsonrpc/src/service.rs
@@ -13,7 +13,7 @@ pub trait RPCService: Sync + Send {
fn name(&self) -> String;
}
-/// Implements the `RPCService` trait for a provided type.
+/// Implements the [`RPCService`] trait for a provided type.
///
/// # Example
///
diff --git a/net/src/connection.rs b/net/src/connection.rs
index 53bcdeb..950f171 100644
--- a/net/src/connection.rs
+++ b/net/src/connection.rs
@@ -7,10 +7,10 @@ use crate::transports::{tcp, udp, unix};
pub type Conn = Box<dyn Connection>;
/// Connection is a generic network connection interface for
-/// `UdpConn`, `TcpConn`, and `UnixConn`.
+/// [`udp::UdpConn`], [`tcp::TcpConn`], and [`unix::UnixConn`].
///
-/// If you are familiar with the Go language, this is similar to the `Conn`
-/// interface <https://pkg.go.dev/net#Conn>
+/// If you are familiar with the Go language, this is similar to the
+/// [Conn](https://pkg.go.dev/net#Conn) interface
#[async_trait]
pub trait Connection: Send + Sync {
/// Returns the remote peer endpoint of this connection
diff --git a/net/src/transports/tcp.rs b/net/src/transports/tcp.rs
index 9b2b928..84aa980 100644
--- a/net/src/transports/tcp.rs
+++ b/net/src/transports/tcp.rs
@@ -13,7 +13,7 @@ use crate::{
Error, Result,
};
-/// TCP network connection implementations of the `Connection` trait.
+/// TCP network connection implementations of the [`Connection`] trait.
pub struct TcpConn {
inner: TcpStream,
read: Mutex<ReadHalf<TcpStream>>,
diff --git a/net/src/transports/udp.rs b/net/src/transports/udp.rs
index 2050226..ca5b94d 100644
--- a/net/src/transports/udp.rs
+++ b/net/src/transports/udp.rs
@@ -9,7 +9,7 @@ use crate::{
Error, Result,
};
-/// UDP network connection implementations of the `Connection` trait.
+/// UDP network connection implementations of the [`Connection`] trait.
pub struct UdpConn {
inner: UdpSocket,
}
diff --git a/net/src/transports/unix.rs b/net/src/transports/unix.rs
index 1a32311..a720d91 100644
--- a/net/src/transports/unix.rs
+++ b/net/src/transports/unix.rs
@@ -8,7 +8,7 @@ use smol::{
use crate::{connection::Connection, endpoint::Endpoint, listener::Listener, Error, Result};
-/// Unix domain socket implementations of the `Connection` trait.
+/// Unix domain socket implementations of the [`Connection`] trait.
pub struct UnixConn {
inner: UnixStream,
read: Mutex<ReadHalf<UnixStream>>,
diff --git a/p2p/src/backend.rs b/p2p/src/backend.rs
index 4410205..2e34f47 100644
--- a/p2p/src/backend.rs
+++ b/p2p/src/backend.rs
@@ -18,8 +18,6 @@ pub type ArcBackend = Arc<Backend>;
/// Backend serves as the central entry point for initiating and managing
/// the P2P network.
-///
-///
pub struct Backend {
/// The Configuration for the P2P network.
config: Arc<Config>,
diff --git a/p2p/src/routing_table/mod.rs b/p2p/src/routing_table/mod.rs
index 35729da..5277c0a 100644
--- a/p2p/src/routing_table/mod.rs
+++ b/p2p/src/routing_table/mod.rs
@@ -39,7 +39,7 @@ pub enum AddEntryResult {
}
/// This is a modified version of the Kademlia Distributed Hash Table (DHT).
-/// https://en.wikipedia.org/wiki/Kademlia
+/// <https://en.wikipedia.org/wiki/Kademlia>
#[derive(Debug)]
pub struct RoutingTable {
key: Key,