From 7f1ada13f123ff38267216d853a2a00df9c07df7 Mon Sep 17 00:00:00 2001 From: Leynos Date: Sun, 3 Aug 2025 12:59:09 +0100 Subject: [PATCH 1/3] Document PushHandleInner purpose --- src/push.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/push.rs b/src/push.rs index 01103745..07e9f074 100644 --- a/src/push.rs +++ b/src/push.rs @@ -85,6 +85,10 @@ impl std::fmt::Display for PushConfigError { impl std::error::Error for PushConfigError {} +/// Shared state for [`PushHandle`]. +/// +/// Holds the high- and low-priority channels alongside an optional rate +/// limiter and dead-letter queue sender used when pushes are discarded. pub(crate) struct PushHandleInner { high_prio_tx: mpsc::Sender, low_prio_tx: mpsc::Sender, @@ -97,7 +101,9 @@ pub(crate) struct PushHandleInner { pub struct PushHandle(Arc>); impl PushHandle { - pub(crate) fn from_arc(arc: Arc>) -> Self { Self(arc) } + pub(crate) fn from_arc(arc: Arc>) -> Self { + Self(arc) + } /// Internal helper to push a frame with the requested priority. /// @@ -253,7 +259,9 @@ impl PushHandle { } /// Downgrade to a `Weak` reference for storage in a registry. - pub(crate) fn downgrade(&self) -> Weak> { Arc::downgrade(&self.0) } + pub(crate) fn downgrade(&self) -> Weak> { + Arc::downgrade(&self.0) + } } /// Receiver ends of the push queues stored by the connection actor. From f85874606a0f8a91c7eafa24bddd9024cdbcb13e Mon Sep 17 00:00:00 2001 From: Leynos Date: Sun, 3 Aug 2025 15:57:42 +0100 Subject: [PATCH 2/3] Document PushHandleInner fields --- src/push.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/push.rs b/src/push.rs index 07e9f074..9412dc81 100644 --- a/src/push.rs +++ b/src/push.rs @@ -89,6 +89,12 @@ impl std::error::Error for PushConfigError {} /// /// Holds the high- and low-priority channels alongside an optional rate /// limiter and dead-letter queue sender used when pushes are discarded. +/// +/// - `high_prio_tx` – channel for frames that must be sent before any +/// low-priority traffic. +/// - `low_prio_tx` – channel for best-effort frames. +/// - `limiter` – optional rate-limiter enforcing global push throughput. +/// - `dlq_tx` – optional dead-letter queue for discarded frames. pub(crate) struct PushHandleInner { high_prio_tx: mpsc::Sender, low_prio_tx: mpsc::Sender, @@ -101,9 +107,7 @@ pub(crate) struct PushHandleInner { pub struct PushHandle(Arc>); impl PushHandle { - pub(crate) fn from_arc(arc: Arc>) -> Self { - Self(arc) - } + pub(crate) fn from_arc(arc: Arc>) -> Self { Self(arc) } /// Internal helper to push a frame with the requested priority. /// @@ -259,9 +263,7 @@ impl PushHandle { } /// Downgrade to a `Weak` reference for storage in a registry. - pub(crate) fn downgrade(&self) -> Weak> { - Arc::downgrade(&self.0) - } + pub(crate) fn downgrade(&self) -> Weak> { Arc::downgrade(&self.0) } } /// Receiver ends of the push queues stored by the connection actor. From d5e22ef1cd17857c4d41d21561ab410797977776 Mon Sep 17 00:00:00 2001 From: Leynos Date: Sun, 3 Aug 2025 15:59:42 +0100 Subject: [PATCH 3/3] Fix formatting --- src/push.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/push.rs b/src/push.rs index 9412dc81..def345ba 100644 --- a/src/push.rs +++ b/src/push.rs @@ -90,8 +90,7 @@ impl std::error::Error for PushConfigError {} /// Holds the high- and low-priority channels alongside an optional rate /// limiter and dead-letter queue sender used when pushes are discarded. /// -/// - `high_prio_tx` – channel for frames that must be sent before any -/// low-priority traffic. +/// - `high_prio_tx` – channel for frames that must be sent before any low-priority traffic. /// - `low_prio_tx` – channel for best-effort frames. /// - `limiter` – optional rate-limiter enforcing global push throughput. /// - `dlq_tx` – optional dead-letter queue for discarded frames.