From 894327ba00b648c0be8de305268ff1b7914d925c Mon Sep 17 00:00:00 2001 From: 4o1x5 <4o1x5@4o1x5.dev> Date: Sat, 23 Nov 2024 22:21:49 +0100 Subject: [PATCH] some docs... --- .gitignore | 1 + src/lib.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 8ea0ee8..b3d3dd3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target result* +scrap.md \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 97f9d76..b8f53ab 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -90,7 +90,7 @@ impl WorkerConfig { /// Enable secure connection to amqp. /// /// # Arguments - /// * `custom_tls` - Optional TLSconfig (if none defaults to lapins choice) + /// * `custom_tls` - Optional [`TlsConfig`] (if none defaults to lapins choice) pub fn enable_tls(mut self, custom_tls: Option) -> Self { match custom_tls { Some(tls) => { @@ -151,10 +151,10 @@ impl ListenerConfig { // TODO implement reconnect impl Worker { - /// Create a new instance of `bunbun-worker` + /// Create a new instance of [`Worker`] /// # Arguments /// * `amqp_server_url` - A string slice that holds the url of the amqp server (e.g. amqp://localhost:5672) - /// * `config` - A worker config, containing the TLS config for now. + /// * `config` - A [`WorkerConfig`], containing the TLS config for now. pub async fn new(amqp_server_url: impl Into, config: WorkerConfig) -> Self { let channel = Self::create_channel(amqp_server_url.into(), config).await; @@ -191,11 +191,11 @@ impl Worker { channel } - /// Add a non-rpc listener to the worker object + /// Add a [`Task`] listener to the worker object /// /// # Arguments /// * `state` - An Arc of the state object that will be passed to the listener - /// * `listener_config` - An Arc of the state object that will be passed to the listener + /// * `listener_config` - [`ListenerConfig`] that holds the configuration for the listener /// ``` /// use bunbun_worker::{Worker, ListenerConfig, WorkerConfig}; /// let server = Worker::new("amqp://localhost:5672", Workerconfig::default()).await; @@ -563,7 +563,7 @@ pub trait RPCTask: Sized + Debug + DeserializeOwned { } /// A regular task -/// Implement this trait to any struct to make it a runnable `non-rpc` job. +/// Implement this trait to any struct to make it a runnable `non-rpc` [`Task`] job. /// /// Examples ///