This is an automated email from the ASF dual-hosted git repository.
jensg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git
The following commit(s) were added to refs/heads/master by this push:
new 9c6c6bf THRIFT-5043 Make TBufferChannel clonable Client: Rust Patch:
Julian Tescher
9c6c6bf is described below
commit 9c6c6bf81a3c934e96378b26fc133f50cf4226a2
Author: Julian Tescher <[email protected]>
AuthorDate: Sun Dec 1 21:43:01 2019 -0800
THRIFT-5043 Make TBufferChannel clonable
Client: Rust
Patch: Julian Tescher
This closes #1956
It is useful for `TBufferChannel` to be `Clone` so that you can use it to
read bytes that were written by a client for use cases like testing or sending
over alternative transports like UDP.
---
lib/rs/src/transport/mem.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/rs/src/transport/mem.rs b/lib/rs/src/transport/mem.rs
index 82c4b57..9874257 100644
--- a/lib/rs/src/transport/mem.rs
+++ b/lib/rs/src/transport/mem.rs
@@ -31,7 +31,7 @@ use super::{ReadHalf, TIoChannel, WriteHalf};
/// `set_readable_bytes(...)`. Callers can then read until the buffer is
/// depleted. No further reads are accepted until the internal read buffer is
/// replenished again.
-#[derive(Debug)]
+#[derive(Clone, Debug)]
pub struct TBufferChannel {
read: Arc<Mutex<ReadData>>,
write: Arc<Mutex<WriteData>>,