From e1b9286430a98222c15d8663f9454fd6a34f6095 Mon Sep 17 00:00:00 2001 From: Lucas Colombo Date: Thu, 6 Jun 2024 12:31:32 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20improve=20doc=20titles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/bus/mod.rs | 4 ++-- lib/rustlers/rustler.rs | 2 +- lib/rustlers/rustlerjar.rs | 4 ++-- lib/rustlers/svc.rs | 14 +++++++------- lib/socket/server.rs | 8 +++++--- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/lib/bus/mod.rs b/lib/bus/mod.rs index a760f15..3729d2e 100644 --- a/lib/bus/mod.rs +++ b/lib/bus/mod.rs @@ -30,7 +30,7 @@ pub trait BusMessage: { } -/// ๐ŸŽ ยป trait for bus **Publisher**s +/// ๐ŸŽ ยป trait for bus `Publisher`s #[async_trait] pub trait PublisherTrait { /// ๐ŸŽ ยป publish a message to the bus @@ -40,7 +40,7 @@ pub trait PublisherTrait { /// ๐ŸŽ ยป trait for bus **Publisher**s #[async_trait] pub trait SubscriberTrait { - /// ๐ŸŽ ยป **stream** + /// ๐ŸŽ ยป stream /// /// returns an `Observable` stream of messages from the redis bus async fn stream(&mut self) -> Result + Send + 'static>>>; diff --git a/lib/rustlers/rustler.rs b/lib/rustlers/rustler.rs index 18e8af3..c0476ba 100644 --- a/lib/rustlers/rustler.rs +++ b/lib/rustlers/rustler.rs @@ -485,7 +485,7 @@ macro_rules! rustler_accessors { }; } -/// **๐ŸŽ ยป rustler builder macro** +/// #### ๐ŸŽ ยป rustler builder macro /// /// The `rustler!` macro is used to define a new `Rustler` struct, expanding the struct definition /// with the required fields and derives, and implementing the `RustlerAccessor` trait for the diff --git a/lib/rustlers/rustlerjar.rs b/lib/rustlers/rustlerjar.rs index c367e80..cea2270 100644 --- a/lib/rustlers/rustlerjar.rs +++ b/lib/rustlers/rustlerjar.rs @@ -5,7 +5,7 @@ use { tokio::sync::Mutex, }; -/// **๐ŸŽ ยป rustlerjar! macro** +/// #### ๐ŸŽ ยป rustlerjar! macro /// /// A macro to create a `RustlerJar` with multiple Rustler instances and their corresponding /// mappings. @@ -38,7 +38,7 @@ macro_rules! rustlerjar { }}; } -/// **๐ŸŽ ยป RustlerJar** +/// #### ๐ŸŽ ยป RustlerJar /// /// A `RustlerJar` is a collection of Rustlers and their corresponding mappings to the markets. /// Which indicates which Rustler should be used for a given market. Rustlers are stored as diff --git a/lib/rustlers/svc.rs b/lib/rustlers/svc.rs index ff127b1..15978be 100644 --- a/lib/rustlers/svc.rs +++ b/lib/rustlers/svc.rs @@ -22,12 +22,12 @@ use { tokio::sync::{mpsc::Sender, Mutex}, }; -/// **๐ŸŽ ยป Rustler Message** +/// #### ๐ŸŽ ยป Rustler Message pub enum RustlerMsg { QuoteMsg(Quote), } -/// **๐ŸŽ ยป create a quote message** +/// #### ๐ŸŽ ยป create a quote message #[inline] pub fn quote( id: String, @@ -47,9 +47,9 @@ pub fn quote( }) } -/// **๐ŸŽ ยป Rustlers Service** +/// #### ๐ŸŽ ยป Rustlers Service /// -/// The `RustlersSvc` is a service that manages the rustlers and orchestrates their executions. +/// `RustlersSvc` is a service that manages the rustlers and orchestrates their executions. pub struct RustlersSvc

where P: PublisherTrait + Send + Sync + 'static + Clone, @@ -64,7 +64,7 @@ impl RustlersSvc where Publisher: PublisherTrait + Send + Sync + 'static + Clone, { - /// **๐ŸŽ ยป create service** + /// #### ๐ŸŽ ยป create service /// /// creates a new instance of the `RustlersSvc` /// @@ -86,7 +86,7 @@ where } } - /// **๐ŸŽ ยป start rustlers** + /// #### ๐ŸŽ ยป start rustlers /// /// gets market data from the the database and starts /// the corresponding rustler for each market @@ -116,7 +116,7 @@ where } } - /// **๐ŸŽ ยป restart rustlers** + /// #### ๐ŸŽ ยป restart rustlers /// /// stops all rustlers and then starts them again pub async fn restart(&self) -> Result<()> { diff --git a/lib/socket/server.rs b/lib/socket/server.rs index 55e554d..acb41fc 100644 --- a/lib/socket/server.rs +++ b/lib/socket/server.rs @@ -38,7 +38,7 @@ pub trait EventDispatcher: Send { ) -> Result<()>; } -/// ๐ŸŽ ยป **`socket::Server`** +/// ๐ŸŽ ยป Socket Server /// -- /// /// A websocket gateway server that listens for incoming connections and dispatches events to the @@ -73,13 +73,15 @@ where }) } - /// **๐ŸŽ ยป `start_no_cb`**: start the server + /// #### ๐ŸŽ ยป start without setting a callback + /// + /// will use a _noop_ callback that will do nothing. pub async fn start_no_cb(&mut self) { let noop_cb = |_: &Request, response: Response| Ok(response); self.start(noop_cb).await; } - /// **๐ŸŽ ยป `start`** + /// #### ๐ŸŽ ยป start the server /// /// Starts the server with a handshake callback. Usefull for customizing the /// handshake process, e.g. checking headers, etc.