rocketmq_protocol/rpc/
rpc_request.rs1use std::any::Any;
10
11use crate::protocol::header::message_operation_header::TopicRequestHeaderTrait;
12use crate::protocol::CommandCustomHeader;
13
14pub struct RpcRequest<H> {
15 pub code: i32,
16 pub header: H,
17 pub body: Option<Box<dyn Any + Send>>,
18}
19
20impl<H> RpcRequest<H>
21where
22 H: CommandCustomHeader + TopicRequestHeaderTrait,
23{
24 pub fn new(code: i32, header: H, body: Option<Box<dyn Any + Send>>) -> Self {
25 Self { code, header, body }
26 }
27}