pub enum Message {
Request {
id: Id,
method: String,
params: Value,
},
Response {
id: Id,
result: Option<Value>,
error: Option<StratumErrorResponse>,
reject_reason: Option<String>,
},
Notification {
method: String,
params: Value,
},
}Variants§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
Stratum does id: null, which is technically wrong according to the JSON-RPC spec, which
states that no id field should be present. This is a work around to allow both cases. If
a server sends a notification with an id field other than null it will be classified as
a request and should just be ignored by any client.
impl<'de> Deserialize<'de> for Message
Stratum does id: null, which is technically wrong according to the JSON-RPC spec, which states that no id field should be present. This is a work around to allow both cases. If a server sends a notification with an id field other than null it will be classified as a request and should just be ignored by any client.
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 StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
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