pub struct ManagedSubscriptionWrapper { /* private fields */ }Expand description
Wrapper around ManagedSubscription with additional context for event streaming
Implementations§
Source§impl ManagedSubscriptionWrapper
impl ManagedSubscriptionWrapper
Sourcepub fn new(
subscription: ManagedSubscription,
registration_id: RegistrationId,
speaker_service_pair: SpeakerServicePair,
) -> Self
pub fn new( subscription: ManagedSubscription, registration_id: RegistrationId, speaker_service_pair: SpeakerServicePair, ) -> Self
Create a new wrapper around a ManagedSubscription
Sourcepub fn registration_id(&self) -> RegistrationId
pub fn registration_id(&self) -> RegistrationId
Get the registration ID
Sourcepub fn speaker_service_pair(&self) -> &SpeakerServicePair
pub fn speaker_service_pair(&self) -> &SpeakerServicePair
Get the speaker/service pair
Sourcepub fn subscription_id(&self) -> &str
pub fn subscription_id(&self) -> &str
Get the UPnP subscription ID
Sourcepub fn needs_renewal(&self) -> bool
pub fn needs_renewal(&self) -> bool
Check if the subscription needs renewal
Sourcepub async fn renew(&self) -> SubscriptionResult<()>
pub async fn renew(&self) -> SubscriptionResult<()>
Renew the subscription
Sourcepub async fn unsubscribe(&self) -> SubscriptionResult<()>
pub async fn unsubscribe(&self) -> SubscriptionResult<()>
Unsubscribe and clean up
Sourcepub async fn record_event_received(&self)
pub async fn record_event_received(&self)
Record that an event was received for this subscription
Sourcepub async fn last_event_time(&self) -> Option<SystemTime>
pub async fn last_event_time(&self) -> Option<SystemTime>
Get the time of the last event received
Sourcepub fn set_polling_active(&self, active: bool)
pub fn set_polling_active(&self, active: bool)
Set whether polling is active for this subscription
Sourcepub fn is_polling_active(&self) -> bool
pub fn is_polling_active(&self) -> bool
Check if polling is active for this subscription
Sourcepub fn created_at(&self) -> SystemTime
pub fn created_at(&self) -> SystemTime
Get creation timestamp
Sourcepub async fn renewal_count(&self) -> u32
pub async fn renewal_count(&self) -> u32
Get renewal count
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ManagedSubscriptionWrapper
impl !RefUnwindSafe for ManagedSubscriptionWrapper
impl Send for ManagedSubscriptionWrapper
impl Sync for ManagedSubscriptionWrapper
impl Unpin for ManagedSubscriptionWrapper
impl UnsafeUnpin for ManagedSubscriptionWrapper
impl !UnwindSafe for ManagedSubscriptionWrapper
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