pub trait TOutputProtocolFactory {
// Required method
fn create(
&mut self,
transport: Rc<RefCell<Box<dyn TTransport>>>,
) -> Box<dyn TOutputProtocol>;
}Expand description
Helper type required by a TSimpleServer to create TOutputProtocol
instances with which to write messages to accepted client connections.
§Examples
use std::cell::RefCell;
use std::rc::Rc;
use rift::protocol::{TBinaryOutputProtocolFactory, TOutputProtocolFactory};
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 o_proto_factory = TBinaryOutputProtocolFactory {};
let mut o_prot = o_proto_factory.create(transport);Required Methods§
Sourcefn create(
&mut self,
transport: Rc<RefCell<Box<dyn TTransport>>>,
) -> Box<dyn TOutputProtocol>
fn create( &mut self, transport: Rc<RefCell<Box<dyn TTransport>>>, ) -> Box<dyn TOutputProtocol>
Create an instance of a TOutputProtocol.