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.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Publish
impl RefUnwindSafe for Publish
impl Send for Publish
impl Sync for Publish
impl Unpin for Publish
impl UnwindSafe for Publish
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