pub struct SubscriptionManager { /* private fields */ }Expand description
Subscription manager
Manages the lifecycle of all WebSocket subscriptions, including:
- Adding and removing subscriptions
- Querying and validating subscriptions
- Tracking the number of active subscriptions
Implementations§
Source§impl SubscriptionManager
impl SubscriptionManager
Sourcepub async fn add_subscription(
&self,
stream: String,
symbol: String,
sub_type: SubscriptionType,
sender: UnboundedSender<Value>,
) -> Result<()>
pub async fn add_subscription( &self, stream: String, symbol: String, sub_type: SubscriptionType, sender: UnboundedSender<Value>, ) -> Result<()>
Sourcepub async fn remove_subscription(&self, stream: &str) -> Result<()>
pub async fn remove_subscription(&self, stream: &str) -> Result<()>
Sourcepub async fn get_subscription(&self, stream: &str) -> Option<Subscription>
pub async fn get_subscription(&self, stream: &str) -> Option<Subscription>
Sourcepub async fn has_subscription(&self, stream: &str) -> bool
pub async fn has_subscription(&self, stream: &str) -> bool
Sourcepub async fn get_all_subscriptions(&self) -> Vec<Subscription>
pub async fn get_all_subscriptions(&self) -> Vec<Subscription>
Returns all registered subscriptions
Sourcepub async fn get_subscriptions_by_symbol(
&self,
symbol: &str,
) -> Vec<Subscription>
pub async fn get_subscriptions_by_symbol( &self, symbol: &str, ) -> Vec<Subscription>
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Returns the number of active subscriptions
Sourcepub async fn send_to_stream(&self, stream: &str, message: Value) -> bool
pub async fn send_to_stream(&self, stream: &str, message: Value) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SubscriptionManager
impl !RefUnwindSafe for SubscriptionManager
impl Send for SubscriptionManager
impl Sync for SubscriptionManager
impl Unpin for SubscriptionManager
impl !UnwindSafe for SubscriptionManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more