actrpc-core 0.1.0

Core types and traits for ActRPC.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use serde::{Deserialize, Serialize};

#[non_exhaustive]
#[derive(Debug, thiserror::Error, Clone, Serialize, Deserialize, PartialEq)]
pub enum ProtocolError {
    #[error("expected method {expected}, got {actual}")]
    UnexpectedMethod { expected: String, actual: String },

    #[error("invalid request params")]
    InvalidRequestParams,

    #[error("mixed JSON-RPC batch is invalid")]
    MixedBatch,

    #[error("invalid message direction: {reason}")]
    InvalidMessageDirection { reason: String },
}