@@ -490,40 +490,6 @@ impl ErrorData {
490490 }
491491}
492492
493- #[ derive( Debug , Serialize , Deserialize , Clone , PartialEq ) ]
494- #[ serde( untagged) ]
495- #[ cfg_attr( feature = "schemars" , derive( schemars:: JsonSchema ) ) ]
496- pub enum JsonRpcBatchRequestItem < Req , Not > {
497- Request ( JsonRpcRequest < Req > ) ,
498- Notification ( JsonRpcNotification < Not > ) ,
499- }
500-
501- impl < Req , Not > JsonRpcBatchRequestItem < Req , Not > {
502- pub fn into_non_batch_message < Resp > ( self ) -> JsonRpcMessage < Req , Resp , Not > {
503- match self {
504- JsonRpcBatchRequestItem :: Request ( r) => JsonRpcMessage :: Request ( r) ,
505- JsonRpcBatchRequestItem :: Notification ( n) => JsonRpcMessage :: Notification ( n) ,
506- }
507- }
508- }
509-
510- #[ derive( Debug , Serialize , Deserialize , Clone , PartialEq ) ]
511- #[ serde( untagged) ]
512- #[ cfg_attr( feature = "schemars" , derive( schemars:: JsonSchema ) ) ]
513- pub enum JsonRpcBatchResponseItem < Resp > {
514- Response ( JsonRpcResponse < Resp > ) ,
515- Error ( JsonRpcError ) ,
516- }
517-
518- impl < Resp > JsonRpcBatchResponseItem < Resp > {
519- pub fn into_non_batch_message < Req , Not > ( self ) -> JsonRpcMessage < Req , Resp , Not > {
520- match self {
521- JsonRpcBatchResponseItem :: Response ( r) => JsonRpcMessage :: Response ( r) ,
522- JsonRpcBatchResponseItem :: Error ( e) => JsonRpcMessage :: Error ( e) ,
523- }
524- }
525- }
526-
527493/// Represents any JSON-RPC message that can be sent or received.
528494///
529495/// This enum covers all possible message types in the JSON-RPC protocol:
@@ -539,10 +505,6 @@ pub enum JsonRpcMessage<Req = Request, Resp = DefaultResponse, Noti = Notificati
539505 Response ( JsonRpcResponse < Resp > ) ,
540506 /// A one-way notification (no response expected)
541507 Notification ( JsonRpcNotification < Noti > ) ,
542- /// Multiple requests sent together
543- BatchRequest ( Vec < JsonRpcBatchRequestItem < Req , Noti > > ) ,
544- /// Multiple responses sent together
545- BatchResponse ( Vec < JsonRpcBatchResponseItem < Resp > > ) ,
546508 /// An error response
547509 Error ( JsonRpcError ) ,
548510}
0 commit comments