Skip to content

Commit 38b1666

Browse files
committed
remove twrite
1 parent 05cffb4 commit 38b1666

3 files changed

Lines changed: 3 additions & 21 deletions

File tree

duva/src/adapters/io/tokio_stream.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::domains::interface::{TRead, TWrite};
1+
use crate::domains::interface::TRead;
22
use crate::domains::peers::command::*;
33
use crate::domains::peers::connections::connection_types::{ReadConnected, WriteConnected};
44
use crate::domains::query_io::SERDE_CONFIG;
@@ -16,13 +16,6 @@ use tokio::net::TcpStream;
1616
const BUFFER_SIZE: usize = 512;
1717
const 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]
2720
impl<T: AsyncReadExt + std::marker::Unpin + Sync + Send + Debug + 'static> TReadBytes for T {
2821
// TCP doesn't inherently delimit messages.

duva/src/domains/cluster_actors/actor/tests/mod.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use crate::domains::peers::connections::inbound::stream::InboundStream;
2424
use crate::domains::peers::service::PeerListener;
2525
use crate::types::Callback;
2626
use crate::{
27-
domains::{IoError, TRead, TWrite},
27+
domains::{IoError, TRead},
2828
make_smart_pointer,
2929
};
3030
use 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]
5852
impl TSerdeDynamicRead for FakeReadWrite {

duva/src/domains/interface.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff 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-
3934
pub trait TSerdeWrite {
4035
fn serialized_write(
4136
&mut self,

0 commit comments

Comments
 (0)