Trait rift::protocol::TInputProtocolFactory [] [src]

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

Helper type required by a TSimpleServer to create TInputProtocol instances with which to read messages from accepted client connections.

Examples

use std::cell::RefCell;
use std::rc::Rc;

use rift::protocol::{TBinaryInputProtocolFactory, TInputProtocolFactory};
use rift::transport::{TTcpTransport, TTransport};

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

let mut i_proto_factory = TBinaryInputProtocolFactory {};
let mut i_prot = i_proto_factory.create(transport);

Required Methods

Create an instance of a TInputProtocol.

Implementors