Trait thrift::protocol::TOutputProtocolFactory
source · pub trait TOutputProtocolFactory {
// Required method
fn create(
&self,
transport: Box<dyn TWriteTransport + Send>
) -> Box<dyn TOutputProtocol + Send>;
}
Expand description
Helper type used by servers to create TOutputProtocol
instances for
accepted client connections.
Examples
Create a TOutputProtocolFactory
and use it to create a TOutputProtocol
.
use thrift::protocol::{TBinaryOutputProtocolFactory, TOutputProtocolFactory};
use thrift::transport::TTcpChannel;
let mut channel = TTcpChannel::new();
channel.open("127.0.0.1:9090").unwrap();
let factory = TBinaryOutputProtocolFactory::new();
let protocol = factory.create(Box::new(channel));
Required Methods§
sourcefn create(
&self,
transport: Box<dyn TWriteTransport + Send>
) -> Box<dyn TOutputProtocol + Send>
fn create( &self, transport: Box<dyn TWriteTransport + Send> ) -> Box<dyn TOutputProtocol + Send>
Create a TOutputProtocol
that writes bytes to transport
.