Enum jsonrpc_pubsub::SubscriptionId
source · 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<SubscriptionId> for SubscriptionId
impl PartialEq<SubscriptionId> for SubscriptionId
source§fn eq(&self, other: &SubscriptionId) -> bool
fn eq(&self, other: &SubscriptionId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for SubscriptionId
impl StructuralEq for SubscriptionId
impl StructuralPartialEq for SubscriptionId
Auto Trait Implementations§
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