pub struct Subscriptions { /* private fields */ }Expand description
The subscriptions one notifier is serving.
Implementations§
Source§impl Subscriptions
impl Subscriptions
Sourcepub fn new(packages: Packages, policy_maximum: Duration) -> Self
pub fn new(packages: Packages, policy_maximum: Duration) -> Self
A notifier serving these packages, granting at most this long.
Sourcepub fn with_capacity(self, capacity: usize) -> Self
pub fn with_capacity(self, capacity: usize) -> Self
Apply a finite concurrent-subscription bound.
Zero is raised to one: a notifier configured with no capacity could advertise packages but never serve one, which is almost certainly a configuration mistake rather than policy.
Sourcepub fn all(&self) -> &[Served]
pub fn all(&self) -> &[Served]
Every subscription being served, terminated ones included until they are swept.
Sourcepub fn on_subscribe(&mut self, request: &Request, now: u64) -> Answer
pub fn on_subscribe(&mut self, request: &Request, now: u64) -> Answer
Answer a SUBSCRIBE.
Sourcepub fn terminate(&mut self, id: &Id, reason: Reason) -> Option<Subscription>
pub fn terminate(&mut self, id: &Id, reason: Reason) -> Option<Subscription>
End a subscription deliberately.
Returns the state to put in the terminating NOTIFY, or None if there was nothing to end.
Sourcepub fn expire(&mut self, now: u64) -> Vec<Id>
pub fn expire(&mut self, now: u64) -> Vec<Id>
Terminate everything that has run out of time, and say which (§4.1.3, reason=timeout).
Sourcepub fn notify_state(&self, id: &Id, now: u64) -> Option<Subscription>
pub fn notify_state(&self, id: &Id, now: u64) -> Option<Subscription>
The Subscription-State a NOTIFY for this subscription should carry.
None when the subscription is terminated or unknown — which is what stops a terminated
subscription being notified. A notifier that produced an active state here for a
subscription it had ended would resurrect it, and the subscriber would go on believing it
was watching something.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Subscriptions
impl RefUnwindSafe for Subscriptions
impl Send for Subscriptions
impl Sync for Subscriptions
impl Unpin for Subscriptions
impl UnsafeUnpin 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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more