THRIFT-4450: Added "seek" implementation to TCompactInputTransport in Rust
Client: rust
This closes #1462
diff --git a/lib/rs/src/protocol/compact.rs b/lib/rs/src/protocol/compact.rs
index dfe11f8..1e67f49 100644
--- a/lib/rs/src/protocol/compact.rs
+++ b/lib/rs/src/protocol/compact.rs
@@ -19,6 +19,7 @@
use integer_encoding::{VarIntReader, VarIntWriter};
use std::convert::From;
use try_from::TryFrom;
+use std::io;
use transport::{TReadTransport, TWriteTransport};
use super::{TFieldIdentifier, TInputProtocol, TInputProtocolFactory, TListIdentifier,
@@ -314,6 +315,16 @@
}
}
+
+impl<T> io::Seek for TCompactInputProtocol<T>
+where
+ T: io::Seek + TReadTransport,
+{
+ fn seek(&mut self, pos: io::SeekFrom) -> io::Result<u64> {
+ self.transport.seek(pos)
+ }
+}
+
/// Factory for creating instances of `TCompactInputProtocol`.
#[derive(Default)]
pub struct TCompactInputProtocolFactory;