File tree Expand file tree Collapse file tree
cluster_actors/actor/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- use crate :: domains:: interface:: { TRead , TWrite } ;
1+ use crate :: domains:: interface:: TRead ;
22use crate :: domains:: peers:: command:: * ;
33use crate :: domains:: peers:: connections:: connection_types:: { ReadConnected , WriteConnected } ;
44use crate :: domains:: query_io:: SERDE_CONFIG ;
@@ -16,13 +16,6 @@ use tokio::net::TcpStream;
1616const BUFFER_SIZE : usize = 512 ;
1717const INITIAL_CAPACITY : usize = 1024 ;
1818
19- #[ async_trait:: async_trait]
20- impl < T : AsyncWriteExt + std:: marker:: Unpin + Sync + Send + Debug + ' static > TWrite for T {
21- async fn write ( & mut self , io : QueryIO ) -> Result < ( ) , IoError > {
22- self . write_all ( & io. serialize ( ) ) . await . map_err ( |e| io_error_from_kind ( e. kind ( ) ) )
23- }
24- }
25-
2619#[ async_trait:: async_trait]
2720impl < T : AsyncReadExt + std:: marker:: Unpin + Sync + Send + Debug + ' static > TReadBytes for T {
2821 // TCP doesn't inherently delimit messages.
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ use crate::domains::peers::connections::inbound::stream::InboundStream;
2424use crate :: domains:: peers:: service:: PeerListener ;
2525use crate :: types:: Callback ;
2626use crate :: {
27- domains:: { IoError , TRead , TWrite } ,
27+ domains:: { IoError , TRead } ,
2828 make_smart_pointer,
2929} ;
3030use std:: collections:: VecDeque ;
@@ -47,12 +47,6 @@ impl FakeReadWrite {
4747 Self ( Arc :: new ( Mutex :: new ( VecDeque :: new ( ) ) ) )
4848 }
4949}
50- #[ async_trait:: async_trait]
51- impl TWrite for FakeReadWrite {
52- async fn write ( & mut self , _io : QueryIO ) -> Result < ( ) , IoError > {
53- panic ! ( )
54- }
55- }
5650
5751#[ async_trait:: async_trait]
5852impl TSerdeDynamicRead for FakeReadWrite {
Original file line number Diff line number Diff line change @@ -26,16 +26,11 @@ pub(crate) trait TSerdeDynamicRead: TRead + Send + Sync + Debug + 'static {
2626}
2727
2828#[ async_trait:: async_trait]
29- pub ( crate ) trait TSerdeDynamicWrite : TWrite + Send + Sync + Debug + ' static {
29+ pub ( crate ) trait TSerdeDynamicWrite : Send + Sync + Debug + ' static {
3030 async fn send ( & mut self , msg : PeerMessage ) -> Result < ( ) , IoError > ;
3131 async fn send_connection_msg ( & mut self , arg : & str ) -> Result < ( ) , IoError > ;
3232}
3333
34- #[ async_trait:: async_trait]
35- pub ( crate ) trait TWrite : Send + Sync + Debug + ' static {
36- async fn write ( & mut self , io : QueryIO ) -> Result < ( ) , IoError > ;
37- }
38-
3934pub trait TSerdeWrite {
4035 fn serialized_write (
4136 & mut self ,
You can’t perform that action at this time.
0 commit comments