pub struct TMultiplexedOutputProtocol<P>where
    P: TOutputProtocol,
{ /* private fields */ }
Expand description

TOutputProtocol that prefixes the service name to all outgoing Thrift messages.

A TMultiplexedOutputProtocol should be used when multiple Thrift services send messages over a single I/O channel. By prefixing service identifiers to outgoing messages receivers are able to demux them and route them to the appropriate service processor. Rust receivers must use a TMultiplexedProcessor to process incoming messages, while other languages must use their corresponding multiplexed processor implementations.

For example, given a service TestService and a service call test_call, this implementation would identify messages as originating from TestService:test_call.

Examples

Create and use a TMultiplexedOutputProtocol.

use thrift::protocol::{TMessageIdentifier, TMessageType, TOutputProtocol};
use thrift::protocol::{TBinaryOutputProtocol, TMultiplexedOutputProtocol};
use thrift::transport::TTcpChannel;

let mut channel = TTcpChannel::new();
channel.open("localhost:9090").unwrap();

let protocol = TBinaryOutputProtocol::new(channel, true);
let mut protocol = TMultiplexedOutputProtocol::new("service_name", protocol);

let ident = TMessageIdentifier::new("svc_call", TMessageType::Call, 1);
protocol.write_message_begin(&ident).unwrap();

Implementations

Create a TMultiplexedOutputProtocol that identifies outgoing messages as originating from a service named service_name and sends them over the wrapped TOutputProtocol. Outgoing messages are encoded and sent by wrapped, not by this instance.

Trait Implementations

Formats the value using the given formatter. Read more
Write the beginning of a Thrift message.
Write the end of a Thrift message.
Write the beginning of a Thrift struct.
Write the end of a Thrift struct.
Write the beginning of a Thrift field.
Write the end of a Thrift field.
Write a STOP field indicating that all the fields in a struct have been written. Read more
Write a fixed-length byte array.
Write a bool.
Write an 8-bit signed integer.
Write a 16-bit signed integer.
Write a 32-bit signed integer.
Write a 64-bit signed integer.
Write a 64-bit float.
Write a fixed-length string.
Write the beginning of a list.
Write the end of a list.
Write the beginning of a set.
Write the end of a set.
Write the beginning of a map.
Write the end of a map.
Flush buffered bytes to the underlying transport.
Write an unsigned byte. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.