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 ttl(self, ttl: Duration) -> Self
Available on crate feature server_2_11
only.
pub fn ttl(self, ttl: Duration) -> Self
server_2_11
only.Sets TTL for a single message.
It sets the Nats-TTL
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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more