pub enum SubscriptionId {
Number(u64),
String(String),
}
Expand description
Unique subscription id.
NOTE Assigning same id to different requests will cause the previous request to be unsubscribed.
Variants§
Number(u64)
A numerical ID, represented by a u64
.
String(String)
A non-numerical ID, for example a hash.
Implementations§
Source§impl SubscriptionId
impl SubscriptionId
Sourcepub fn parse_value(val: &Value) -> Option<SubscriptionId>
pub fn parse_value(val: &Value) -> Option<SubscriptionId>
Parses core::Value
into unique subscription id.
Trait Implementations§
Source§impl Clone for SubscriptionId
impl Clone for SubscriptionId
Source§fn clone(&self) -> SubscriptionId
fn clone(&self) -> SubscriptionId
Returns a copy of the value. Read more
1.0.0 · 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 SubscriptionId
impl Debug for SubscriptionId
Source§impl From<String> for SubscriptionId
impl From<String> for SubscriptionId
Source§impl From<SubscriptionId> for Value
impl From<SubscriptionId> for Value
Source§fn from(sub: SubscriptionId) -> Self
fn from(sub: SubscriptionId) -> Self
Converts to this type from the input type.
Source§impl From<u16> for SubscriptionId
impl From<u16> for SubscriptionId
Source§impl From<u32> for SubscriptionId
impl From<u32> for SubscriptionId
Source§impl From<u64> for SubscriptionId
impl From<u64> for SubscriptionId
Source§impl From<u8> for SubscriptionId
impl From<u8> for SubscriptionId
Source§impl Hash for SubscriptionId
impl Hash for SubscriptionId
Source§impl PartialEq for SubscriptionId
impl PartialEq for SubscriptionId
impl Eq for SubscriptionId
impl StructuralPartialEq for SubscriptionId
Auto Trait Implementations§
impl Freeze for SubscriptionId
impl RefUnwindSafe for SubscriptionId
impl Send for SubscriptionId
impl Sync for SubscriptionId
impl Unpin for SubscriptionId
impl UnwindSafe for SubscriptionId
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