pub struct StatefulProcessor<C: ServiceContext> { /* private fields */ }Expand description
Stateful message processor that wraps a context and handler
Implementations§
Source§impl<C: ServiceContext> StatefulProcessor<C>
impl<C: ServiceContext> StatefulProcessor<C>
Sourcepub fn new<H>(context: C, handler: H) -> Selfwhere
H: StatefulHandler<C> + 'static,
pub fn new<H>(context: C, handler: H) -> Selfwhere
H: StatefulHandler<C> + 'static,
Create a new stateful processor with context and handler
Sourcepub fn builder(context: C) -> StatefulProcessorBuilder<C>
pub fn builder(context: C) -> StatefulProcessorBuilder<C>
Create a builder for configuring the processor
Trait Implementations§
Source§impl<C: ServiceContext> MessageProcessor for StatefulProcessor<C>
impl<C: ServiceContext> MessageProcessor for StatefulProcessor<C>
Source§fn process_message<'life0, 'async_trait>(
&'life0 self,
message: Message,
) -> Pin<Box<dyn Future<Output = Option<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn process_message<'life0, 'async_trait>(
&'life0 self,
message: Message,
) -> Pin<Box<dyn Future<Output = Option<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Process a single JSON-RPC message
Source§fn process_batch<'life0, 'async_trait>(
&'life0 self,
messages: Vec<Message>,
) -> Pin<Box<dyn Future<Output = Vec<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn process_batch<'life0, 'async_trait>(
&'life0 self,
messages: Vec<Message>,
) -> Pin<Box<dyn Future<Output = Vec<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Process a batch of JSON-RPC messages
Source§fn supports_batching(&self) -> bool
fn supports_batching(&self) -> bool
Check if batch processing is supported
Source§fn get_capabilities(&self) -> ProcessorCapabilities
fn get_capabilities(&self) -> ProcessorCapabilities
Get processor capabilities
Auto Trait Implementations§
impl<C> Freeze for StatefulProcessor<C>
impl<C> !RefUnwindSafe for StatefulProcessor<C>
impl<C> Send for StatefulProcessor<C>
impl<C> Sync for StatefulProcessor<C>
impl<C> Unpin for StatefulProcessor<C>
impl<C> UnsafeUnpin for StatefulProcessor<C>
impl<C> !UnwindSafe for StatefulProcessor<C>
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