pub struct SubscriptionMessage(/* private fields */);
Expand description
Subscription message.
Implementations§
source§impl SubscriptionMessage
impl SubscriptionMessage
sourcepub fn from_json(t: &impl Serialize) -> Result<SubscriptionMessage, Error>
pub fn from_json(t: &impl Serialize) -> Result<SubscriptionMessage, Error>
Create a new subscription message from JSON.
Fails if the value couldn’t be serialized.
sourcepub fn new(
method: &str,
subscription: SubscriptionId<'_>,
result: &impl Serialize,
) -> Result<SubscriptionMessage, Error>
pub fn new( method: &str, subscription: SubscriptionId<'_>, result: &impl Serialize, ) -> Result<SubscriptionMessage, Error>
Create a subscription message this is more efficient than SubscriptionMessage::from_json
because it only allocates once.
Fails if the json result
couldn’t be serialized.
Trait Implementations§
source§impl Clone for SubscriptionMessage
impl Clone for SubscriptionMessage
source§fn clone(&self) -> SubscriptionMessage
fn clone(&self) -> SubscriptionMessage
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 SubscriptionMessage
impl Debug for SubscriptionMessage
source§impl<T> From<T> for SubscriptionMessage
impl<T> From<T> for SubscriptionMessage
source§fn from(s: T) -> SubscriptionMessage
fn from(s: T) -> SubscriptionMessage
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SubscriptionMessage
impl RefUnwindSafe for SubscriptionMessage
impl Send for SubscriptionMessage
impl Sync for SubscriptionMessage
impl Unpin for SubscriptionMessage
impl UnwindSafe for SubscriptionMessage
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)