pub enum SubscriptionId<'a> {
Num(u64),
Str(Cow<'a, str>),
}Expand description
Id of a subscription, communicated by the server.
Variants§
Implementations§
Source§impl SubscriptionId<'_>
impl SubscriptionId<'_>
Sourcepub fn into_owned(self) -> SubscriptionId<'static>
pub fn into_owned(self) -> SubscriptionId<'static>
Convert SubscriptionId<'a> to SubscriptionId<'static> so that it can be moved across
threads.
This can cause an allocation if the id is a string.
Trait Implementations§
Source§impl<'a> Clone for SubscriptionId<'a>
impl<'a> Clone for SubscriptionId<'a>
Source§impl<'a> Debug for SubscriptionId<'a>
impl<'a> Debug for SubscriptionId<'a>
Source§impl<'de: 'a, 'a> Deserialize<'de> for SubscriptionId<'a>
Parses the id without buffering it: the untagged derive would first copy a peer-supplied array
or object into an intermediate tree before rejecting it.
impl<'de: 'a, 'a> Deserialize<'de> for SubscriptionId<'a>
Parses the id without buffering it: the untagged derive would first copy a peer-supplied array or object into an intermediate tree before rejecting it.
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<'a> Eq for SubscriptionId<'a>
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_id: SubscriptionId<'_>) -> Self
fn from(sub_id: SubscriptionId<'_>) -> Self
Converts to this type from the input type.
Source§impl From<u64> for SubscriptionId<'_>
impl From<u64> for SubscriptionId<'_>
Source§impl<'a> Hash for SubscriptionId<'a>
impl<'a> Hash for SubscriptionId<'a>
Source§impl<'a> PartialEq for SubscriptionId<'a>
impl<'a> PartialEq for SubscriptionId<'a>
Source§impl<'a> Serialize for SubscriptionId<'a>
impl<'a> Serialize for SubscriptionId<'a>
impl<'a> StructuralPartialEq for SubscriptionId<'a>
Auto Trait Implementations§
impl<'a> Freeze for SubscriptionId<'a>
impl<'a> RefUnwindSafe for SubscriptionId<'a>
impl<'a> Send for SubscriptionId<'a>
impl<'a> Sync for SubscriptionId<'a>
impl<'a> Unpin for SubscriptionId<'a>
impl<'a> UnsafeUnpin for SubscriptionId<'a>
impl<'a> UnwindSafe for SubscriptionId<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes
Size for each variant:
Num: 16 bytesStr: 24 bytes