pub struct ProjectorHandler { /* private fields */ }Expand description
gRPC projector service implementation.
Wraps a handle function to process events and produce projections.
Implementations§
Source§impl ProjectorHandler
impl ProjectorHandler
Sourcepub fn with_handle(self, handle_fn: ProjectorHandleFn) -> Self
pub fn with_handle(self, handle_fn: ProjectorHandleFn) -> Self
Set the handle function (function pointer).
Sourcepub fn with_handle_fn<H>(self, handle_fn: H) -> Self
pub fn with_handle_fn<H>(self, handle_fn: H) -> Self
Set the handle function (closure).
Trait Implementations§
Source§impl ProjectorService for ProjectorHandler
impl ProjectorService for ProjectorHandler
Source§fn handle<'life0, 'async_trait>(
&'life0 self,
request: Request<EventBook>,
) -> Pin<Box<dyn Future<Output = Result<Response<Projection>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle<'life0, 'async_trait>(
&'life0 self,
request: Request<EventBook>,
) -> Pin<Box<dyn Future<Output = Result<Response<Projection>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Async projection - projector should persist and return
Source§fn handle_speculative<'life0, 'async_trait>(
&'life0 self,
request: Request<EventBook>,
) -> Pin<Box<dyn Future<Output = Result<Response<Projection>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_speculative<'life0, 'async_trait>(
&'life0 self,
request: Request<EventBook>,
) -> Pin<Box<dyn Future<Output = Result<Response<Projection>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Speculative processing - projector must avoid external side effects
Auto Trait Implementations§
impl Freeze for ProjectorHandler
impl !RefUnwindSafe for ProjectorHandler
impl Send for ProjectorHandler
impl Sync for ProjectorHandler
impl Unpin for ProjectorHandler
impl UnsafeUnpin for ProjectorHandler
impl !UnwindSafe for ProjectorHandler
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request