Trait thrift::protocol::TInputProtocolFactory [] [src]

pub trait TInputProtocolFactory {
    fn create(&mut self,
          transport: Rc<RefCell<Box<TTransport>>>)
          -> Box<TInputProtocol>; }

Helper type used by servers to create TInputProtocol instances for accepted client connections.

Examples

Create a TInputProtocolFactory and use it to create a TInputProtocol.

use std::cell::RefCell;
use std::rc::Rc;
use thrift::protocol::{TBinaryInputProtocolFactory, TInputProtocolFactory};
use thrift::transport::{TTcpTransport, TTransport};

let mut transport = TTcpTransport::new();
transport.open("127.0.0.1:9090").unwrap();
let transport = Rc::new(RefCell::new(Box::new(transport) as Box<TTransport>));

let mut i_proto_factory = TBinaryInputProtocolFactory::new();
let i_prot = i_proto_factory.create(transport);

Required Methods

Create a TInputProtocol that reads bytes from transport.

Implementors