pub struct SeekHandle;Expand description
The key reading the subscription’s PulsarSeeker out of PulsarContext (and out of
PulsarBatchContext on the batch path): the reposition handle every delivery of the
subscription shares.
One seek covers every topic and every partition of the subscription’s consumer.
§Examples
use ruststream_pulsar::SeekHandle;
use ruststream_pulsar::prelude::*;
/// Skips forward past a region the producer marked poisoned.
#[subscriber(PulsarSubscription::new("jobs", "workers"))]
async fn work(job: &Job, Ctx(seeker): Ctx<SeekHandle>) -> HandlerOutcome {
if let Some(resume_at) = job.poisoned_until
&& seeker.seek(PulsarPosition::timestamp(resume_at)).await.is_err()
{
return HandlerOutcome::retry();
}
HandlerOutcome::ack()
}Trait Implementations§
Source§impl Clone for SeekHandle
impl Clone for SeekHandle
Source§impl ContextField for SeekHandle
impl ContextField for SeekHandle
Source§type Context = PulsarContext
type Context = PulsarContext
The per-delivery context type this key reads from.
Source§type Value = PulsarSeeker
type Value = PulsarSeeker
The owned value the key yields.
Source§fn read(self, src: &PulsarContext) -> PulsarSeeker
fn read(self, src: &PulsarContext) -> PulsarSeeker
Reads this key’s field out of
src. Named apart from Field::get so a key
implementing both traits stays unambiguous to call.impl Copy for SeekHandle
Source§impl Debug for SeekHandle
impl Debug for SeekHandle
Source§impl Default for SeekHandle
impl Default for SeekHandle
impl Eq for SeekHandle
Source§impl Field<PulsarBatchContext> for SeekHandle
impl Field<PulsarBatchContext> for SeekHandle
Source§type Value<'a> = &'a PulsarSeeker
type Value<'a> = &'a PulsarSeeker
The value read through this key, borrowed from the source for
'a.Source§fn get(self, src: &PulsarBatchContext) -> &PulsarSeeker
fn get(self, src: &PulsarBatchContext) -> &PulsarSeeker
Reads this key’s field out of
src.Source§impl Field<PulsarContext> for SeekHandle
impl Field<PulsarContext> for SeekHandle
Source§type Value<'a> = &'a PulsarSeeker
type Value<'a> = &'a PulsarSeeker
The value read through this key, borrowed from the source for
'a.Source§fn get(self, src: &PulsarContext) -> &PulsarSeeker
fn get(self, src: &PulsarContext) -> &PulsarSeeker
Reads this key’s field out of
src.Source§impl Hash for SeekHandle
impl Hash for SeekHandle
Source§impl PartialEq for SeekHandle
impl PartialEq for SeekHandle
impl StructuralPartialEq for SeekHandle
Auto Trait Implementations§
impl Freeze for SeekHandle
impl RefUnwindSafe for SeekHandle
impl Send for SeekHandle
impl Sync for SeekHandle
impl Unpin for SeekHandle
impl UnsafeUnpin for SeekHandle
impl UnwindSafe for SeekHandle
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<K> CtxKey for Kwhere
K: ContextField,
impl<K> CtxKey for Kwhere
K: ContextField,
Source§type Value = <K as ContextField>::Value
type Value = <K as ContextField>::Value
The owned value the extractor binds.
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more