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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)