Struct nebula_fbthrift_meta::server::MetaServiceProcessor
source · pub struct MetaServiceProcessor<P, H, R, RS> { /* private fields */ }
Expand description
Processor for MetaService’s methods.
Implementations§
source§impl<P, H, R, RS> MetaServiceProcessor<P, H, R, RS>where
P: Protocol + Send + Sync + 'static,
<P as Protocol>::Frame: Send + 'static,
<P as Protocol>::Deserializer: Send,
H: MetaService,
R: RequestContext<Name = CStr> + Send + Sync + 'static,
RS: ReplyState<<P as Protocol>::Frame, RequestContext = R> + Send + Sync + 'static,
<R as RequestContext>::ContextStack: ContextStack<Name = <R as RequestContext>::Name, Buffer = <<P as Protocol>::Frame as Framing>::DecBuf> + Send + Sync,
impl<P, H, R, RS> MetaServiceProcessor<P, H, R, RS>where
P: Protocol + Send + Sync + 'static,
<P as Protocol>::Frame: Send + 'static,
<P as Protocol>::Deserializer: Send,
H: MetaService,
R: RequestContext<Name = CStr> + Send + Sync + 'static,
RS: ReplyState<<P as Protocol>::Frame, RequestContext = R> + Send + Sync + 'static,
<R as RequestContext>::ContextStack: ContextStack<Name = <R as RequestContext>::Name, Buffer = <<P as Protocol>::Frame as Framing>::DecBuf> + Send + Sync,
pub fn new(service: H) -> MetaServiceProcessor<P, H, R, RS>
pub fn into_inner(self) -> H
Trait Implementations§
source§impl<P, H, R, RS> Clone for MetaServiceProcessor<P, H, R, RS>where
P: Clone,
H: Clone,
R: Clone,
RS: Clone,
impl<P, H, R, RS> Clone for MetaServiceProcessor<P, H, R, RS>where
P: Clone,
H: Clone,
R: Clone,
RS: Clone,
source§fn clone(&self) -> MetaServiceProcessor<P, H, R, RS>
fn clone(&self) -> MetaServiceProcessor<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> Debug for MetaServiceProcessor<P, H, R, RS>where
P: Debug,
H: Debug,
R: Debug,
RS: Debug,
impl<P, H, R, RS> Debug for MetaServiceProcessor<P, H, R, RS>where
P: Debug,
H: Debug,
R: Debug,
RS: Debug,
source§impl<P, H, R, RS> ServiceProcessor<P> for MetaServiceProcessor<P, H, R, RS>where
P: Protocol + Send + Sync + 'static,
<P as Protocol>::Deserializer: Send,
H: MetaService,
<P as Protocol>::Frame: Send + 'static,
R: RequestContext<Name = CStr> + Send + Sync + 'static,
<R as RequestContext>::ContextStack: ContextStack<Name = <R as RequestContext>::Name, Buffer = <<P as Protocol>::Frame as Framing>::DecBuf> + Send + Sync + 'static,
RS: ReplyState<<P as Protocol>::Frame, RequestContext = R> + Send + Sync + 'static,
impl<P, H, R, RS> ServiceProcessor<P> for MetaServiceProcessor<P, H, R, RS>where
P: Protocol + Send + Sync + 'static,
<P as Protocol>::Deserializer: Send,
H: MetaService,
<P as Protocol>::Frame: Send + 'static,
R: RequestContext<Name = CStr> + Send + Sync + 'static,
<R as RequestContext>::ContextStack: ContextStack<Name = <R as RequestContext>::Name, Buffer = <<P as Protocol>::Frame as Framing>::DecBuf> + Send + Sync + 'static,
RS: ReplyState<<P as Protocol>::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 as Protocol>::Deserializer,
_r: &'life2 R,
_reply_state: Arc<Mutex<RS>>,
_seqid: u32
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MetaServiceProcessor<P, H, R, RS>: 'async_trait,
fn handle_method<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
idx: usize,
_p: &'life1 mut <P as Protocol>::Deserializer,
_r: &'life2 R,
_reply_state: Arc<Mutex<RS>>,
_seqid: u32
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MetaServiceProcessor<P, H, R, RS>: '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, Error>
fn create_interaction_idx(&self, name: &str) -> Result<usize, Error>
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 as Protocol>::Frame, RequestContext = <MetaServiceProcessor<P, H, R, RS> as ServiceProcessor<P>>::RequestContext, ReplyState = <MetaServiceProcessor<P, H, R, RS> as ServiceProcessor<P>>::ReplyState, Handler = ()> + Send + 'static>, Error>
fn handle_create_interaction(
&self,
idx: usize
) -> Result<Arc<dyn ThriftService<<P as Protocol>::Frame, RequestContext = <MetaServiceProcessor<P, H, R, RS> as ServiceProcessor<P>>::RequestContext, ReplyState = <MetaServiceProcessor<P, H, R, RS> as ServiceProcessor<P>>::ReplyState, Handler = ()> + Send + 'static>, Error>
Given a creation method index, it produces a fresh interaction processor
source§impl<P, H, R, RS> ThriftService<<P as Protocol>::Frame> for MetaServiceProcessor<P, H, R, RS>where
P: Protocol + Send + Sync + 'static,
<P as Protocol>::Deserializer: Send,
<P as Protocol>::Frame: Send + 'static,
H: MetaService,
R: RequestContext<Name = CStr> + Send + Sync + 'static,
<R as RequestContext>::ContextStack: ContextStack<Name = <R as RequestContext>::Name, Buffer = <<P as Protocol>::Frame as Framing>::DecBuf> + Send + Sync + 'static,
RS: ReplyState<<P as Protocol>::Frame, RequestContext = R> + Send + Sync + 'static,
impl<P, H, R, RS> ThriftService<<P as Protocol>::Frame> for MetaServiceProcessor<P, H, R, RS>where
P: Protocol + Send + Sync + 'static,
<P as Protocol>::Deserializer: Send,
<P as Protocol>::Frame: Send + 'static,
H: MetaService,
R: RequestContext<Name = CStr> + Send + Sync + 'static,
<R as RequestContext>::ContextStack: ContextStack<Name = <R as RequestContext>::Name, Buffer = <<P as Protocol>::Frame as Framing>::DecBuf> + Send + Sync + 'static,
RS: ReplyState<<P as Protocol>::Frame, RequestContext = R> + Send + Sync + 'static,
type Handler = H
type RequestContext = R
type ReplyState = RS
fn call<'life0, 'life1, 'async_trait>(
&'life0 self,
req: <<P as Protocol>::Frame as Framing>::DecBuf,
req_ctxt: &'life1 R,
reply_state: Arc<Mutex<RS>>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
MetaServiceProcessor<P, H, R, RS>: 'async_trait,
fn create_interaction(
&self,
name: &str
) -> Result<Arc<dyn ThriftService<<P as Protocol>::Frame, RequestContext = R, ReplyState = RS, Handler = ()> + Send + 'static>, Error>
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