pub struct StorageServiceProcessor<P, H, R, RS> { /* private fields */ }Expand description
Processor for StorageService’s methods.
Implementations§
Source§impl<P, H, R, RS> StorageServiceProcessor<P, H, R, RS>where
P: Protocol + Send + Sync + 'static,
<P as Protocol>::Frame: Send + 'static,
<P as Protocol>::Deserializer: Send,
H: StorageService,
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> StorageServiceProcessor<P, H, R, RS>where
P: Protocol + Send + Sync + 'static,
<P as Protocol>::Frame: Send + 'static,
<P as Protocol>::Deserializer: Send,
H: StorageService,
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) -> StorageServiceProcessor<P, H, R, RS>
pub fn into_inner(self) -> H
Trait Implementations§
Source§impl<P, H, R, RS> Clone for StorageServiceProcessor<P, H, R, RS>
impl<P, H, R, RS> Clone for StorageServiceProcessor<P, H, R, RS>
Source§fn clone(&self) -> StorageServiceProcessor<P, H, R, RS>
fn clone(&self) -> StorageServiceProcessor<P, H, R, RS>
Returns a duplicate 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 StorageServiceProcessor<P, H, R, RS>
impl<P, H, R, RS> Debug for StorageServiceProcessor<P, H, R, RS>
Source§impl<P, H, R, RS> ServiceProcessor<P> for StorageServiceProcessor<P, H, R, RS>where
P: Protocol + Send + Sync + 'static,
<P as Protocol>::Deserializer: Send,
H: StorageService,
<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 StorageServiceProcessor<P, H, R, RS>where
P: Protocol + Send + Sync + 'static,
<P as Protocol>::Deserializer: Send,
H: StorageService,
<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>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
StorageServiceProcessor<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>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
StorageServiceProcessor<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 = <StorageServiceProcessor<P, H, R, RS> as ServiceProcessor<P>>::RequestContext, ReplyState = <StorageServiceProcessor<P, H, R, RS> as ServiceProcessor<P>>::ReplyState, Handler = ()> + Send>, Error>
fn handle_create_interaction( &self, idx: usize, ) -> Result<Arc<dyn ThriftService<<P as Protocol>::Frame, RequestContext = <StorageServiceProcessor<P, H, R, RS> as ServiceProcessor<P>>::RequestContext, ReplyState = <StorageServiceProcessor<P, H, R, RS> as ServiceProcessor<P>>::ReplyState, Handler = ()> + Send>, Error>
Given a creation method index, it produces a fresh interaction processor
Source§impl<P, H, R, RS> ThriftService<<P as Protocol>::Frame> for StorageServiceProcessor<P, H, R, RS>where
P: Protocol + Send + Sync + 'static,
<P as Protocol>::Deserializer: Send,
<P as Protocol>::Frame: Send + 'static,
H: StorageService,
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 StorageServiceProcessor<P, H, R, RS>where
P: Protocol + Send + Sync + 'static,
<P as Protocol>::Deserializer: Send,
<P as Protocol>::Frame: Send + 'static,
H: StorageService,
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>>where
'life0: 'async_trait,
'life1: 'async_trait,
StorageServiceProcessor<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>, 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
Auto Trait Implementations§
impl<P, H, R, RS> Freeze for StorageServiceProcessor<P, H, R, RS>where
H: Freeze,
impl<P, H, R, RS> RefUnwindSafe for StorageServiceProcessor<P, H, R, RS>
impl<P, H, R, RS> Send for StorageServiceProcessor<P, H, R, RS>
impl<P, H, R, RS> Sync for StorageServiceProcessor<P, H, R, RS>
impl<P, H, R, RS> Unpin for StorageServiceProcessor<P, H, R, RS>
impl<P, H, R, RS> UnwindSafe for StorageServiceProcessor<P, H, R, RS>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more