pub struct HookedOffsetStore<S: OffsetStore> { /* private fields */ }Expand description
Offset store wrapper that invokes post-commit hooks
Wraps an inner OffsetStore and calls registered hooks after each commit.
Implementations§
Source§impl<S: OffsetStore> HookedOffsetStore<S>
impl<S: OffsetStore> HookedOffsetStore<S>
Sourcepub fn add_hook(self, hook: Arc<dyn PostCommitHook>) -> Self
pub fn add_hook(self, hook: Arc<dyn PostCommitHook>) -> Self
Add a post-commit hook
Sourcepub fn with_hooks(self, hooks: Vec<Arc<dyn PostCommitHook>>) -> Self
pub fn with_hooks(self, hooks: Vec<Arc<dyn PostCommitHook>>) -> Self
Add multiple post-commit hooks
Trait Implementations§
Source§impl<S: OffsetStore> OffsetStore for HookedOffsetStore<S>
impl<S: OffsetStore> OffsetStore for HookedOffsetStore<S>
Source§fn load(
&self,
topic_id: u32,
consumer_id: u64,
) -> Result<Option<u64>, ClientError>
fn load( &self, topic_id: u32, consumer_id: u64, ) -> Result<Option<u64>, ClientError>
Load the stored offset for a topic and consumer Read more
Source§fn save(
&self,
topic_id: u32,
consumer_id: u64,
offset: u64,
) -> Result<(), ClientError>
fn save( &self, topic_id: u32, consumer_id: u64, offset: u64, ) -> Result<(), ClientError>
Save the current offset for a topic and consumer Read more
Auto Trait Implementations§
impl<S> !Freeze for HookedOffsetStore<S>
impl<S> !RefUnwindSafe for HookedOffsetStore<S>
impl<S> Send for HookedOffsetStore<S>
impl<S> Sync for HookedOffsetStore<S>
impl<S> Unpin for HookedOffsetStore<S>where
S: Unpin,
impl<S> UnsafeUnpin for HookedOffsetStore<S>where
S: UnsafeUnpin,
impl<S> !UnwindSafe for HookedOffsetStore<S>
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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