pub(super) struct Subscriptions {
subs: Mutex<HashMap<SubscriptionID, Arc<Subscription>>>,
sub_buffer_size: usize,
}
Expand description
Manages subscriptions for the client.
Fields§
§subs: Mutex<HashMap<SubscriptionID, Arc<Subscription>>>
§sub_buffer_size: usize
Implementations§
Source§impl Subscriptions
impl Subscriptions
Sourcepub(super) fn new(sub_buffer_size: usize) -> Arc<Self>
pub(super) fn new(sub_buffer_size: usize) -> Arc<Self>
Creates a new Subscriptions
.
Sourcepub(super) async fn subscribe(&self, id: SubscriptionID) -> Arc<Subscription>
pub(super) async fn subscribe(&self, id: SubscriptionID) -> Arc<Subscription>
Returns a new Subscription
Sourcepub(super) async fn unsubscribe(&self, id: &SubscriptionID)
pub(super) async fn unsubscribe(&self, id: &SubscriptionID)
Unsubscribe from the provided subscription id.
Sourcepub(super) async fn notify(&self, nt: Notification) -> Result<()>
pub(super) async fn notify(&self, nt: Notification) -> Result<()>
Notifies the subscription about the given notification.
Auto Trait Implementations§
impl !Freeze for Subscriptions
impl !RefUnwindSafe for Subscriptions
impl Send for Subscriptions
impl Sync for Subscriptions
impl Unpin for Subscriptions
impl UnwindSafe for Subscriptions
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