#[non_exhaustive]pub struct EventDelivery {
pub subject: EventSubject,
pub msg_id: String,
pub body: Bytes,
pub stream_sequence: u64,
pub delivered_count: i64,
/* private fields */
}Expand description
A stored event. Commit your own transaction before calling Self::ack.
Dropping a delivery does not acknowledge it; the server may redeliver it.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.subject: EventSubject§msg_id: String§body: Bytes§stream_sequence: u64§delivered_count: i64Implementations§
Source§impl EventDelivery
impl EventDelivery
Sourcepub fn headers(&self) -> &Headers
pub fn headers(&self) -> &Headers
Headers copied once from NATS. A repeated header keeps its first value.
Sourcepub fn header(&self, name: &str) -> Option<&str>
pub fn header(&self, name: &str) -> Option<&str>
Looks up a header by its stored name, keeping the first repeated value.
Sourcepub async fn ack(&self) -> Result<()>
pub async fn ack(&self) -> Result<()>
Acknowledges the event after the caller’s own commit, waiting for the server to confirm receipt. No reader operation acknowledges automatically.
Auto Trait Implementations§
impl !Freeze for EventDelivery
impl !RefUnwindSafe for EventDelivery
impl !UnwindSafe for EventDelivery
impl Forget for EventDelivery
impl Move for EventDelivery
impl Send for EventDelivery
impl Sync for EventDelivery
impl Unpin for EventDelivery
impl UnsafeUnpin for EventDelivery
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