pub struct TMultiplexedProcessor { /* private fields */ }
Expand description

A TProcessor that can demux service calls to multiple underlying Thrift services.

Users register service-specific TProcessor instances with a TMultiplexedProcessor, and then register that processor with a server implementation. Following that, all incoming service calls are automatically routed to the service-specific TProcessor.

A TMultiplexedProcessor can only handle messages sent by a TMultiplexedOutputProtocol.

Implementations§

source§

impl TMultiplexedProcessor

source

pub fn new() -> TMultiplexedProcessor

Create a new TMultiplexedProcessor with no registered service-specific processors.

source

pub fn register<S: Into<String>>( &mut self, service_name: S, processor: Box<dyn TProcessor + Send + Sync>, as_default: bool ) -> Result<()>

Register a service-specific processor for the service named service_name. This implementation is also backwards-compatible with non-multiplexed clients. Set as_default to true to allow non-namespaced requests to be dispatched to a default processor.

Returns success if a new entry was inserted. Returns an error if:

  • A processor exists for service_name
  • You attempt to register a processor as default, and an existing default exists

Trait Implementations§

source§

impl Debug for TMultiplexedProcessor

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for TMultiplexedProcessor

source§

fn default() -> TMultiplexedProcessor

Returns the “default value” for a type. Read more
source§

impl TProcessor for TMultiplexedProcessor

source§

fn process( &self, i_prot: &mut dyn TInputProtocol, o_prot: &mut dyn TOutputProtocol ) -> Result<()>

Process a Thrift service call. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.