diff --git a/common/nym-lp-data/src/clients/types.rs b/common/nym-lp-data/src/clients/types.rs index 226b9bd032..879b0f8bcc 100644 --- a/common/nym-lp-data/src/clients/types.rs +++ b/common/nym-lp-data/src/clients/types.rs @@ -124,7 +124,7 @@ where const OVERHEAD_SIZE: usize = T::OVERHEAD_SIZE; fn to_transport_packet( - &self, + &mut self, frame: AddressedTimedData, ) -> AddressedTimedData { self.transport.to_transport_packet(frame) diff --git a/common/nym-lp-data/src/common/helpers.rs b/common/nym-lp-data/src/common/helpers.rs index 529188e8c0..7ff9bd85dc 100644 --- a/common/nym-lp-data/src/common/helpers.rs +++ b/common/nym-lp-data/src/common/helpers.rs @@ -40,7 +40,7 @@ where type Frame = Vec; const OVERHEAD_SIZE: usize = 0; fn to_transport_packet( - &self, + &mut self, frame: AddressedTimedPayload, ) -> AddressedTimedData { frame.data_transform(|data| data.into()) @@ -83,7 +83,11 @@ where { type Frame = Vec; type Error = std::convert::Infallible; - fn packet_to_frame(&self, packet: Pkt, timestamp: Ts) -> Result, Self::Error> { + fn packet_to_frame( + &mut self, + packet: Pkt, + timestamp: Ts, + ) -> Result, Self::Error> { Ok(TimedData { timestamp, data: packet.into(), diff --git a/common/nym-lp-data/src/common/traits.rs b/common/nym-lp-data/src/common/traits.rs index 4910d064a9..bbe9e6db90 100644 --- a/common/nym-lp-data/src/common/traits.rs +++ b/common/nym-lp-data/src/common/traits.rs @@ -66,7 +66,7 @@ pub trait Transport { type Frame; const OVERHEAD_SIZE: usize; fn to_transport_packet( - &self, + &mut self, frame: AddressedTimedData, ) -> AddressedTimedData; } @@ -88,7 +88,7 @@ pub trait TransportUnwrap { type Frame; type Error; fn packet_to_frame( - &self, + &mut self, packet: Pkt, timestamp: Ts, ) -> Result, Self::Error>; diff --git a/common/nym-lp-data/tests/integration/common/mod.rs b/common/nym-lp-data/tests/integration/common/mod.rs index 252d00a860..15360cde73 100644 --- a/common/nym-lp-data/tests/integration/common/mod.rs +++ b/common/nym-lp-data/tests/integration/common/mod.rs @@ -210,7 +210,7 @@ impl Transport for LpTransport { type Frame = LpFrame; const OVERHEAD_SIZE: usize = LpHeader::SIZE; fn to_transport_packet( - &self, + &mut self, input: AddressedTimedData, ) -> AddressedTimedData { AddressedTimedData::new_addressed( diff --git a/nym-mix-sim/src/client/simple.rs b/nym-mix-sim/src/client/simple.rs index 7c705f6b63..e000c7bee6 100644 --- a/nym-mix-sim/src/client/simple.rs +++ b/nym-mix-sim/src/client/simple.rs @@ -191,7 +191,7 @@ impl Transport for SimpleClientWrappingPipe type Frame = SimpleFrame; const OVERHEAD_SIZE: usize = >::OVERHEAD_SIZE; fn to_transport_packet( - &self, + &mut self, frame: AddressedTimedData, ) -> AddressedTimedData { self.0.to_transport_packet(frame) @@ -239,7 +239,7 @@ impl TransportUnwrap for SimpleClientUnwrapping { type Frame = SimpleFrame; type Error = anyhow::Error; fn packet_to_frame( - &self, + &mut self, packet: SimplePacket, timestamp: Ts, ) -> anyhow::Result> { diff --git a/nym-mix-sim/src/node/simple.rs b/nym-mix-sim/src/node/simple.rs index fb2e51f3f0..3b666674dc 100644 --- a/nym-mix-sim/src/node/simple.rs +++ b/nym-mix-sim/src/node/simple.rs @@ -128,7 +128,7 @@ impl Transport for SimpleProcessingNode { type Frame = SimpleFrame; const OVERHEAD_SIZE: usize = >::OVERHEAD_SIZE; fn to_transport_packet( - &self, + &mut self, frame: AddressedTimedData, ) -> AddressedTimedData { self.wrapper.to_transport_packet(frame) @@ -157,7 +157,7 @@ impl TransportUnwrap for SimpleProcessingNode { type Frame = SimpleFrame; type Error = anyhow::Error; fn packet_to_frame( - &self, + &mut self, packet: SimplePacket, timestamp: Ts, ) -> anyhow::Result> { diff --git a/nym-mix-sim/src/packet/simple.rs b/nym-mix-sim/src/packet/simple.rs index b0ff11f9d0..7a58ae857b 100644 --- a/nym-mix-sim/src/packet/simple.rs +++ b/nym-mix-sim/src/packet/simple.rs @@ -221,7 +221,7 @@ impl Transport for SimpleWireWrapper { type Frame = SimpleFrame; const OVERHEAD_SIZE: usize = 16; fn to_transport_packet( - &self, + &mut self, frame: AddressedTimedData, ) -> AddressedTimedData { // SAFETY: If the pipeline is implemented properly, frames perfectly fit in a packet @@ -266,7 +266,7 @@ impl TransportUnwrap for SimpleWireUnwrapper { type Frame = SimpleFrame; type Error = anyhow::Error; fn packet_to_frame( - &self, + &mut self, packet: SimplePacket, timestamp: Ts, ) -> anyhow::Result> {