Skip to content

Commit

Permalink
THRIFT-4450: Added "seek" implementation to TCompactInputTransport in…
Browse files Browse the repository at this point in the history
… Rust

Client: rust

This closes #1462
  • Loading branch information
vchekan authored and jeking3 committed Jan 11, 2018
1 parent 1b855d4 commit d3355af
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/rs/src/protocol/compact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
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,
Expand Down Expand Up @@ -314,6 +315,16 @@ where
}
}


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;
Expand Down

0 comments on commit d3355af

Please sign in to comment.