pub enum JsonRpc<N, R> {
    Request(usize, R),
    Notification(N),
    CustomRequest(usizeValue),
    CustomNotification(Value),
}

Variants

Request(usize, R)

Notification(N)

CustomRequest(usizeValue)

CustomNotification(Value)

Trait Implementations

Formats the value using the given formatter. Read more

This function disentangles the various cases:

  1. If we have an id then it is a request

  2. Otherwise it’s a notification that doesn’t require a response.

Furthermore we distinguish between the built-in types and the custom user notifications/methods:

  1. We either match a built-in type above,

  2. Or it’s a custom one, so we pass it around just as a serde_json::Value

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.