Skip to main content

InMemoryStreamCursor

Struct InMemoryStreamCursor 

Source
pub struct InMemoryStreamCursor { /* private fields */ }
Expand description

A cursor on one durable. Several cursors may share a durable, as several pullers may share a JetStream durable: an unsettled delivery is withheld from the others until its ack wait expires, then redelivered to whichever pulls next.

Trait Implementations§

Source§

impl Drop for InMemoryStreamCursor

A dropped cursor gives its unsettled delivery back at once instead of after the ack wait, so a reopened cursor in the same process replays it without waiting (JetStream would wait for the ack wait to run out). The delivery still counts towards the message’s delivery count.

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl StreamCursor for InMemoryStreamCursor

Source§

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,

Source§

fn ack<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = BusResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

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,

Source§

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.
Source§

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.