pub trait StreamCursor: Send {
// Required methods
fn next<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = BusResult<Option<StreamDelivery>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn ack<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = BusResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn nak<'life0, 'async_trait>(
&'life0 mut self,
delay: Duration,
) -> Pin<Box<dyn Future<Output = BusResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn term<'life0, 'life1, 'async_trait>(
&'life0 mut self,
reason: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = BusResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn in_progress<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = BusResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
A cursor for an already-created durable, selected by its associated registry identity.
At most one delivery is in flight per cursor: ack, nak and term each
settle it, after which next may be called again. Each of them, and
in_progress, returns Ok only once the server has recorded it.
Required Methods§
fn next<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = BusResult<Option<StreamDelivery>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ack<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = BusResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn nak<'life0, 'async_trait>(
&'life0 mut self,
delay: Duration,
) -> Pin<Box<dyn Future<Output = BusResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn term<'life0, 'life1, 'async_trait>(
&'life0 mut self,
reason: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = BusResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn term<'life0, 'life1, 'async_trait>(
&'life0 mut self,
reason: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = BusResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Settles the current delivery terminally: it is not acknowledged as
processed and it is never redelivered (JetStream +TERM). reason
is recorded with the termination where the backend can carry one
(JetStream’s +TERM <reason>), for example body_absent.
Sourcefn in_progress<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = BusResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn in_progress<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = BusResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Reports that the current delivery is still being worked on (JetStream
+WPI): the ack-wait clock restarts from now, so a handler slower than
one ack wait is not redelivered under it. The delivery stays in flight
and must still be settled with ack, nak or term.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".