pub struct RaftexServiceProcessor<P, H, R, RS> { /* private fields */ }
Expand description
Processor for RaftexService’s methods.
Implementations§
source§impl<P, H, R, RS> RaftexServiceProcessor<P, H, R, RS>where
P: Protocol + Send + Sync + 'static,
P::Frame: Send + 'static,
P::Deserializer: Send,
H: RaftexService,
R: RequestContext<Name = CStr> + Send + Sync + 'static,
RS: ReplyState<P::Frame, RequestContext = R> + Send + Sync + 'static,
<R as RequestContext>::ContextStack: ContextStack<Name = R::Name, Buffer = ProtocolDecoded<P>> + Send + Sync,
impl<P, H, R, RS> RaftexServiceProcessor<P, H, R, RS>where
P: Protocol + Send + Sync + 'static,
P::Frame: Send + 'static,
P::Deserializer: Send,
H: RaftexService,
R: RequestContext<Name = CStr> + Send + Sync + 'static,
RS: ReplyState<P::Frame, RequestContext = R> + Send + Sync + 'static,
<R as RequestContext>::ContextStack: ContextStack<Name = R::Name, Buffer = ProtocolDecoded<P>> + Send + Sync,
pub fn new(service: H) -> Self
pub fn into_inner(self) -> H
Trait Implementations§
source§impl<P: Clone, H: Clone, R: Clone, RS: Clone> Clone for RaftexServiceProcessor<P, H, R, RS>
impl<P: Clone, H: Clone, R: Clone, RS: Clone> Clone for RaftexServiceProcessor<P, H, R, RS>
source§fn clone(&self) -> RaftexServiceProcessor<P, H, R, RS>
fn clone(&self) -> RaftexServiceProcessor<P, H, R, RS>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<P, H, R, RS> ServiceProcessor<P> for RaftexServiceProcessor<P, H, R, RS>where
P: Protocol + Send + Sync + 'static,
P::Deserializer: Send,
H: RaftexService,
P::Frame: Send + 'static,
R: RequestContext<Name = CStr> + Send + Sync + 'static,
<R as RequestContext>::ContextStack: ContextStack<Name = R::Name, Buffer = ProtocolDecoded<P>> + Send + Sync + 'static,
RS: ReplyState<P::Frame, RequestContext = R> + Send + Sync + 'static,
impl<P, H, R, RS> ServiceProcessor<P> for RaftexServiceProcessor<P, H, R, RS>where
P: Protocol + Send + Sync + 'static,
P::Deserializer: Send,
H: RaftexService,
P::Frame: Send + 'static,
R: RequestContext<Name = CStr> + Send + Sync + 'static,
<R as RequestContext>::ContextStack: ContextStack<Name = R::Name, Buffer = ProtocolDecoded<P>> + Send + Sync + 'static,
RS: ReplyState<P::Frame, RequestContext = R> + Send + Sync + 'static,
type RequestContext = R
type ReplyState = RS
source§fn method_idx(&self, name: &[u8]) -> Result<usize, ApplicationException>
fn method_idx(&self, name: &[u8]) -> Result<usize, ApplicationException>
Given a method name, return a reference to the processor for that index.
source§fn handle_method<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
idx: usize,
_p: &'life1 mut P::Deserializer,
_r: &'life2 R,
_reply_state: Arc<Mutex<RS>>,
_seqid: u32
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn handle_method<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
idx: usize,
_p: &'life1 mut P::Deserializer,
_r: &'life2 R,
_reply_state: Arc<Mutex<RS>>,
_seqid: u32
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Given a method index and the remains of the message input, get a future
for the result of the method. This will only be called if the corresponding
method_idx()
returns an (index, ServiceProcessor) tuple.
frame
is a reference to the frame containing the request.
request
is a deserializer instance set up to decode the request.source§fn create_interaction_idx(&self, name: &str) -> Result<usize>
fn create_interaction_idx(&self, name: &str) -> Result<usize>
Given a method name, return a reference to the interaction creation fn for that index
source§fn handle_create_interaction(
&self,
idx: usize
) -> Result<Arc<dyn ThriftService<P::Frame, Handler = (), RequestContext = Self::RequestContext, ReplyState = Self::ReplyState> + Send + 'static>>
fn handle_create_interaction(
&self,
idx: usize
) -> Result<Arc<dyn ThriftService<P::Frame, Handler = (), RequestContext = Self::RequestContext, ReplyState = Self::ReplyState> + Send + 'static>>
Given a creation method index, it produces a fresh interaction processor
source§impl<P, H, R, RS> ThriftService<<P as Protocol>::Frame> for RaftexServiceProcessor<P, H, R, RS>where
P: Protocol + Send + Sync + 'static,
P::Deserializer: Send,
P::Frame: Send + 'static,
H: RaftexService,
R: RequestContext<Name = CStr> + Send + Sync + 'static,
<R as RequestContext>::ContextStack: ContextStack<Name = R::Name, Buffer = ProtocolDecoded<P>> + Send + Sync + 'static,
RS: ReplyState<P::Frame, RequestContext = R> + Send + Sync + 'static,
impl<P, H, R, RS> ThriftService<<P as Protocol>::Frame> for RaftexServiceProcessor<P, H, R, RS>where
P: Protocol + Send + Sync + 'static,
P::Deserializer: Send,
P::Frame: Send + 'static,
H: RaftexService,
R: RequestContext<Name = CStr> + Send + Sync + 'static,
<R as RequestContext>::ContextStack: ContextStack<Name = R::Name, Buffer = ProtocolDecoded<P>> + Send + Sync + 'static,
RS: ReplyState<P::Frame, RequestContext = R> + Send + Sync + 'static,
type Handler = H
type RequestContext = R
type ReplyState = RS
fn call<'life0, 'life1, 'async_trait>(
&'life0 self,
req: ProtocolDecoded<P>,
req_ctxt: &'life1 R,
reply_state: Arc<Mutex<RS>>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_interaction(
&self,
name: &str
) -> Result<Arc<dyn ThriftService<P::Frame, Handler = (), RequestContext = R, ReplyState = RS> + Send + 'static>>
source§fn get_method_names(&self) -> &'static [&'static str]
fn get_method_names(&self) -> &'static [&'static str]
Returns function names this thrift service is able to handle, similar
to the keys of C++’s createMethodMetadata(). Read more