@@ -39,46 +39,18 @@ impl WipeWritePermOfBrokerRequestHeader {
39
39
}
40
40
}
41
41
42
- #[ derive( Debug , Clone , Deserialize , Serialize , Default ) ]
42
+ #[ derive( Debug , Clone , Deserialize , Serialize , Default , RequestHeaderCodec ) ]
43
43
#[ serde( rename_all = "camelCase" ) ]
44
44
pub struct WipeWritePermOfBrokerResponseHeader {
45
45
pub wipe_topic_count : i32 ,
46
46
}
47
47
48
48
impl WipeWritePermOfBrokerResponseHeader {
49
- const WIPE_TOPIC_COUNT : & ' static str = "wipeTopicCount" ;
50
-
51
49
pub fn new ( wipe_topic_count : i32 ) -> Self {
52
50
Self { wipe_topic_count }
53
51
}
54
52
}
55
53
56
- impl CommandCustomHeader for WipeWritePermOfBrokerResponseHeader {
57
- fn to_map ( & self ) -> Option < HashMap < CheetahString , CheetahString > > {
58
- Some ( HashMap :: from ( [ (
59
- CheetahString :: from_static_str ( Self :: WIPE_TOPIC_COUNT ) ,
60
- CheetahString :: from_string ( self . wipe_topic_count . to_string ( ) ) ,
61
- ) ] ) )
62
- }
63
- }
64
-
65
- impl FromMap for WipeWritePermOfBrokerResponseHeader {
66
- type Error = rocketmq_error:: RocketmqError ;
67
-
68
- type Target = Self ;
69
-
70
- fn from ( map : & HashMap < CheetahString , CheetahString > ) -> Result < Self :: Target , Self :: Error > {
71
- Ok ( WipeWritePermOfBrokerResponseHeader {
72
- wipe_topic_count : map
73
- . get ( & CheetahString :: from_static_str (
74
- WipeWritePermOfBrokerResponseHeader :: WIPE_TOPIC_COUNT ,
75
- ) )
76
- . and_then ( |s| s. parse :: < i32 > ( ) . ok ( ) )
77
- . unwrap_or ( 0 ) ,
78
- } )
79
- }
80
- }
81
-
82
54
#[ derive( Debug , Clone , Deserialize , Serialize , Default ) ]
83
55
#[ serde( rename_all = "camelCase" ) ]
84
56
pub struct AddWritePermOfBrokerRequestHeader {
0 commit comments