pub trait TInputProtocolFactory {
// Required method
fn create(
&mut self,
transport: Rc<RefCell<Box<dyn TTransport>>>,
) -> Box<dyn TInputProtocol>;
}
Expand description
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§
Sourcefn create(
&mut self,
transport: Rc<RefCell<Box<dyn TTransport>>>,
) -> Box<dyn TInputProtocol>
fn create( &mut self, transport: Rc<RefCell<Box<dyn TTransport>>>, ) -> Box<dyn TInputProtocol>
Create an instance of a TInputProtocol
.