File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -100,3 +100,41 @@ impl Request for SocketRequest<'_> {
100100 self . header . msg_id ( )
101101 }
102102}
103+
104+ pub mod test {
105+ use super :: * ;
106+ use std:: net:: { Ipv4Addr , SocketAddrV4 } ;
107+
108+ pub struct TestRequest {
109+ msg_id : MsgId ,
110+ }
111+
112+ impl TestRequest {
113+ pub fn new ( msg_id : MsgId ) -> Self {
114+ Self { msg_id }
115+ }
116+ }
117+
118+ impl Request for TestRequest {
119+ async fn respond < M : Msg + Serializable > ( self , _msg : & M ) -> Result < ( ) > {
120+ // do nothing
121+ Ok ( ( ) )
122+ }
123+
124+ fn authenticate_connection ( & mut self ) {
125+ // do nothing
126+ }
127+
128+ fn addr ( & self ) -> SocketAddr {
129+ SocketAddrV4 :: new ( Ipv4Addr :: UNSPECIFIED , 0 ) . into ( )
130+ }
131+
132+ fn msg_id ( & self ) -> MsgId {
133+ self . msg_id
134+ }
135+
136+ fn deserialize_msg < M : Msg + Deserializable > ( & self ) -> Result < M > {
137+ unimplemented ! ( )
138+ }
139+ }
140+ }
You can’t perform that action at this time.
0 commit comments