Struct async_nats::jetstream::context::Publish
source · pub struct Publish { /* private fields */ }
Expand description
Used for building customized publish
message.
Implementations§
source§impl Publish
impl Publish
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.