pub struct Subscription {
pub state: State,
pub expires: Option<Duration>,
pub reason: Option<Reason>,
pub retry_after: Option<Duration>,
}Expand description
A parsed Subscription-State (RFC 6665 §4.1.3).
Fields§
§state: StateWhich state.
expires: Option<Duration>How long is left, for active and pending.
§4.1.3 makes it a SHOULD there and meaningless on terminated.
reason: Option<Reason>Why it ended, for terminated.
retry_after: Option<Duration>How long to wait before re-subscribing, when the reason gives one.
Implementations§
Source§impl Subscription
impl Subscription
Sourcepub fn terminated(reason: Reason) -> Self
pub fn terminated(reason: Reason) -> Self
A terminated subscription, with the reason it ended.
Sourcepub fn is_terminated(self_: &Self) -> bool
pub fn is_terminated(self_: &Self) -> bool
Whether this says the subscription is over.
Trait Implementations§
Source§impl Clone for Subscription
impl Clone for Subscription
Source§fn clone(&self) -> Subscription
fn clone(&self) -> Subscription
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Subscription
impl Debug for Subscription
Source§impl PartialEq for Subscription
impl PartialEq for Subscription
Source§fn eq(&self, other: &Subscription) -> bool
fn eq(&self, other: &Subscription) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for Subscription
impl StructuralPartialEq for Subscription
Auto Trait Implementations§
impl Freeze for Subscription
impl RefUnwindSafe for Subscription
impl Send for Subscription
impl Sync for Subscription
impl Unpin for Subscription
impl UnsafeUnpin for Subscription
impl UnwindSafe for Subscription
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