StorageServiceProcessor

Struct StorageServiceProcessor 

Source
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,

Source

pub fn new(service: H) -> StorageServiceProcessor<P, H, R, RS>

Source

pub fn into_inner(self) -> H

Trait Implementations§

Source§

impl<P, H, R, RS> Clone for StorageServiceProcessor<P, H, R, RS>
where P: Clone, H: Clone, R: Clone, RS: Clone,

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl<P, H, R, RS> Debug for StorageServiceProcessor<P, H, R, RS>
where P: Debug, H: Debug, R: Debug, RS: Debug,

Source§

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

Formats the value using the given formatter. Read more
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,

Source§

type RequestContext = R

Source§

type ReplyState = RS

Source§

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,

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>

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>

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,

Source§

type Handler = H

Source§

type RequestContext = R

Source§

type ReplyState = RS

Source§

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,

Source§

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]

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>
where H: Send, P: Send, R: Send, RS: Send,

§

impl<P, H, R, RS> Sync for StorageServiceProcessor<P, H, R, RS>
where H: Sync, P: Sync, R: Sync, RS: Sync,

§

impl<P, H, R, RS> Unpin for StorageServiceProcessor<P, H, R, RS>
where H: Unpin, P: Unpin, R: Unpin, RS: Unpin,

§

impl<P, H, R, RS> UnwindSafe for StorageServiceProcessor<P, H, R, RS>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more