aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/message.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/message.rs b/src/message.rs
index 7cf1918..61d01d0 100644
--- a/src/message.rs
+++ b/src/message.rs
@@ -53,7 +53,6 @@ pub trait Message: Serialize + for<'de> Deserialize<'de> + Send + Sync + 'static
/// Req<M> is cheaply clonable to allow the request to be sent to different
/// peers (Clone will panic if the stream is a ByteStream).
pub struct Req<M: Message> {
- pub(crate) _phantom: PhantomData<M>,
pub(crate) msg: Arc<M>,
pub(crate) msg_ser: Option<Bytes>,
pub(crate) stream: AttachedStream,
@@ -104,7 +103,6 @@ impl<M: Message> Req<M> {
pub(crate) fn from_enc(enc: ReqEnc) -> Result<Self, rmp_serde::decode::Error> {
let msg = rmp_serde::decode::from_read_ref(&enc.msg)?;
Ok(Req {
- _phantom: Default::default(),
msg: Arc::new(msg),
msg_ser: Some(enc.msg),
stream: enc
@@ -124,7 +122,6 @@ impl<M: Message> IntoReq<M> for M {
fn into_req(self) -> Result<Req<M>, rmp_serde::encode::Error> {
let msg_ser = rmp_to_vec_all_named(&self)?;
Ok(Req {
- _phantom: Default::default(),
msg: Arc::new(self),
msg_ser: Some(Bytes::from(msg_ser)),
stream: AttachedStream::None,
@@ -132,7 +129,6 @@ impl<M: Message> IntoReq<M> for M {
}
fn into_req_local(self) -> Req<M> {
Req {
- _phantom: Default::default(),
msg: Arc::new(self),
msg_ser: None,
stream: AttachedStream::None,
@@ -159,7 +155,6 @@ impl<M: Message> Clone for Req<M> {
}
};
Self {
- _phantom: Default::default(),
msg: self.msg.clone(),
msg_ser: self.msg_ser.clone(),
stream,
@@ -331,7 +326,7 @@ impl ReqEnc {
Self::decode_aux(stream).await.map_err(|_| Error::Framing)
}
- pub(crate) async fn decode_aux(stream: ByteStream) -> Result<Self, ReadExactError> {
+ async fn decode_aux(stream: ByteStream) -> Result<Self, ReadExactError> {
let mut reader = ByteStreamReader::new(stream);
let prio = reader.read_u8().await?;
@@ -415,7 +410,7 @@ impl RespEnc {
Self::decode_aux(stream).await.map_err(|_| Error::Framing)
}
- pub(crate) async fn decode_aux(stream: ByteStream) -> Result<Self, ReadExactError> {
+ async fn decode_aux(stream: ByteStream) -> Result<Self, ReadExactError> {
let mut reader = ByteStreamReader::new(stream);
let is_err = reader.read_u8().await?;