pub struct JsMessage {
pub subject: String,
pub payload: Vec<u8>,
pub sequence: u64,
pub delivered: u32,
/* private fields */
}Expand description
A message from JetStream with ack capabilities.
Fields§
§subject: StringOriginal NATS message.
payload: Vec<u8>Message payload.
sequence: u64Stream sequence number.
delivered: u32Delivery count.
Implementations§
Source§impl JsMessage
impl JsMessage
Sourcepub async fn ack(&self, client: &mut NatsClient, cx: &Cx) -> Result<(), JsError>
pub async fn ack(&self, client: &mut NatsClient, cx: &Cx) -> Result<(), JsError>
Acknowledge the message (marks as processed).
Sourcepub async fn nack(
&self,
client: &mut NatsClient,
cx: &Cx,
) -> Result<(), JsError>
pub async fn nack( &self, client: &mut NatsClient, cx: &Cx, ) -> Result<(), JsError>
Negative acknowledge (request redelivery).
Sourcepub async fn in_progress(
&self,
client: &mut NatsClient,
cx: &Cx,
) -> Result<(), JsError>
pub async fn in_progress( &self, client: &mut NatsClient, cx: &Cx, ) -> Result<(), JsError>
Acknowledge in progress (extend ack deadline).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for JsMessage
impl RefUnwindSafe for JsMessage
impl Send for JsMessage
impl Sync for JsMessage
impl Unpin for JsMessage
impl UnsafeUnpin for JsMessage
impl UnwindSafe for JsMessage
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: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).