feat: ✨ improve doc titles
This commit is contained in:
parent
dbd234c78a
commit
e1b9286430
@ -30,7 +30,7 @@ pub trait BusMessage:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 🐎 » trait for bus **Publisher**s
|
/// 🐎 » trait for bus `Publisher`s
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
pub trait PublisherTrait<RM: BusMessage> {
|
pub trait PublisherTrait<RM: BusMessage> {
|
||||||
/// 🐎 » publish a message to the bus
|
/// 🐎 » publish a message to the bus
|
||||||
@ -40,7 +40,7 @@ pub trait PublisherTrait<RM: BusMessage> {
|
|||||||
/// 🐎 » trait for bus **Publisher**s
|
/// 🐎 » trait for bus **Publisher**s
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
pub trait SubscriberTrait<RM: BusMessage> {
|
pub trait SubscriberTrait<RM: BusMessage> {
|
||||||
/// 🐎 » **stream**
|
/// 🐎 » stream
|
||||||
///
|
///
|
||||||
/// returns an `Observable` stream of messages from the redis bus
|
/// returns an `Observable` stream of messages from the redis bus
|
||||||
async fn stream(&mut self) -> Result<Pin<Box<dyn Stream<Item = RM> + Send + 'static>>>;
|
async fn stream(&mut self) -> Result<Pin<Box<dyn Stream<Item = RM> + Send + 'static>>>;
|
||||||
|
|||||||
@ -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
|
/// 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
|
/// with the required fields and derives, and implementing the `RustlerAccessor` trait for the
|
||||||
|
|||||||
@ -5,7 +5,7 @@ use {
|
|||||||
tokio::sync::Mutex,
|
tokio::sync::Mutex,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// **🐎 » rustlerjar! macro**
|
/// #### 🐎 » rustlerjar! macro
|
||||||
///
|
///
|
||||||
/// A macro to create a `RustlerJar` with multiple Rustler instances and their corresponding
|
/// A macro to create a `RustlerJar` with multiple Rustler instances and their corresponding
|
||||||
/// mappings.
|
/// mappings.
|
||||||
@ -38,7 +38,7 @@ macro_rules! rustlerjar {
|
|||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// **🐎 » RustlerJar**
|
/// #### 🐎 » RustlerJar
|
||||||
///
|
///
|
||||||
/// A `RustlerJar` is a collection of Rustlers and their corresponding mappings to the markets.
|
/// 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
|
/// Which indicates which Rustler should be used for a given market. Rustlers are stored as
|
||||||
|
|||||||
@ -22,12 +22,12 @@ use {
|
|||||||
tokio::sync::{mpsc::Sender, Mutex},
|
tokio::sync::{mpsc::Sender, Mutex},
|
||||||
};
|
};
|
||||||
|
|
||||||
/// **🐎 » Rustler Message**
|
/// #### 🐎 » Rustler Message
|
||||||
pub enum RustlerMsg {
|
pub enum RustlerMsg {
|
||||||
QuoteMsg(Quote),
|
QuoteMsg(Quote),
|
||||||
}
|
}
|
||||||
|
|
||||||
/// **🐎 » create a quote message**
|
/// #### 🐎 » create a quote message
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn quote(
|
pub fn quote(
|
||||||
id: String,
|
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<P>
|
pub struct RustlersSvc<P>
|
||||||
where
|
where
|
||||||
P: PublisherTrait<Quote> + Send + Sync + 'static + Clone,
|
P: PublisherTrait<Quote> + Send + Sync + 'static + Clone,
|
||||||
@ -64,7 +64,7 @@ impl<Publisher> RustlersSvc<Publisher>
|
|||||||
where
|
where
|
||||||
Publisher: PublisherTrait<Quote> + Send + Sync + 'static + Clone,
|
Publisher: PublisherTrait<Quote> + Send + Sync + 'static + Clone,
|
||||||
{
|
{
|
||||||
/// **🐎 » create service**
|
/// #### 🐎 » create service
|
||||||
///
|
///
|
||||||
/// creates a new instance of the `RustlersSvc`
|
/// 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
|
/// gets market data from the the database and starts
|
||||||
/// the corresponding rustler for each market
|
/// the corresponding rustler for each market
|
||||||
@ -116,7 +116,7 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// **🐎 » restart rustlers**
|
/// #### 🐎 » restart rustlers
|
||||||
///
|
///
|
||||||
/// stops all rustlers and then starts them again
|
/// stops all rustlers and then starts them again
|
||||||
pub async fn restart(&self) -> Result<()> {
|
pub async fn restart(&self) -> Result<()> {
|
||||||
|
|||||||
@ -38,7 +38,7 @@ pub trait EventDispatcher: Send {
|
|||||||
) -> Result<()>;
|
) -> Result<()>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 🐎 » **`socket::Server`**
|
/// 🐎 » Socket Server
|
||||||
/// --
|
/// --
|
||||||
///
|
///
|
||||||
/// A websocket gateway server that listens for incoming connections and dispatches events to the
|
/// 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) {
|
pub async fn start_no_cb(&mut self) {
|
||||||
let noop_cb = |_: &Request, response: Response| Ok(response);
|
let noop_cb = |_: &Request, response: Response| Ok(response);
|
||||||
self.start(noop_cb).await;
|
self.start(noop_cb).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// **🐎 » `start`**
|
/// #### 🐎 » start the server
|
||||||
///
|
///
|
||||||
/// Starts the server with a handshake callback. Usefull for customizing the
|
/// Starts the server with a handshake callback. Usefull for customizing the
|
||||||
/// handshake process, e.g. checking headers, etc.
|
/// handshake process, e.g. checking headers, etc.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user