pub struct PublishMessage { /* private fields */ }Expand description
Used for building customized publish message.
Implementations§
Source§impl PublishMessage
impl PublishMessage
Sourcepub fn header<N: IntoHeaderName, V: IntoHeaderValue>(
self,
name: N,
value: V,
) -> Self
pub fn header<N: IntoHeaderName, V: IntoHeaderValue>( self, name: N, value: V, ) -> Self
A shorthand to add a single header.
Sourcepub fn message_id<T: AsRef<str>>(self, id: T) -> Self
pub fn message_id<T: AsRef<str>>(self, id: T) -> Self
Sets the Nats-Msg-Id header, that is used by stream deduplicate window.
Sourcepub fn expected_last_message_id<T: AsRef<str>>(self, last_message_id: T) -> Self
pub fn expected_last_message_id<T: AsRef<str>>(self, last_message_id: T) -> Self
Sets expected last message ID.
It sets the Nats-Expected-Last-Msg-Id header with provided value.
Sourcepub fn expected_last_sequence(self, last_sequence: u64) -> Self
pub fn expected_last_sequence(self, last_sequence: u64) -> Self
Sets the last expected stream sequence.
It sets the Nats-Expected-Last-Sequence header with provided value.
Sourcepub fn expected_last_subject_sequence(self, subject_sequence: u64) -> Self
pub fn expected_last_subject_sequence(self, subject_sequence: u64) -> Self
Sets the last expected stream sequence for a subject this message will be published to.
It sets the Nats-Expected-Last-Subject-Sequence header with provided value.
Sourcepub fn expected_stream<T: AsRef<str>>(self, stream: T) -> Self
pub fn expected_stream<T: AsRef<str>>(self, stream: T) -> Self
Sets the expected stream name.
It sets the Nats-Expected-Stream header with provided value.
Sourcepub fn outbound_message<S: ToSubject>(self, subject: S) -> OutboundMessage
pub fn outbound_message<S: ToSubject>(self, subject: S) -> OutboundMessage
Creates an crate::jetstream::message::OutboundMessage that can be sent using crate::jetstream::context::traits::Publisher::publish_message.
Trait Implementations§
Source§impl Clone for PublishMessage
impl Clone for PublishMessage
Source§fn clone(&self) -> PublishMessage
fn clone(&self) -> PublishMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PublishMessage
impl Debug for PublishMessage
Source§impl Default for PublishMessage
impl Default for PublishMessage
Source§fn default() -> PublishMessage
fn default() -> PublishMessage
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for PublishMessage
impl RefUnwindSafe for PublishMessage
impl Send for PublishMessage
impl Sync for PublishMessage
impl Unpin for PublishMessage
impl UnwindSafe for PublishMessage
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