pub struct MessageBuilder<'a> { /* private fields */ }Expand description
Producer-bound counterpart to OutgoingMessage. Mirrors Java’s
TypedMessageBuilder — the producer is captured at construction so the terminal send()
has no extra argument.
Implementations§
Source§impl MessageBuilder<'_>
impl MessageBuilder<'_>
Sourcepub fn key(self, key: impl Into<String>) -> Self
pub fn key(self, key: impl Into<String>) -> Self
Set the routing key. See OutgoingMessage::key.
Sourcepub fn ordering_key(self, key: impl Into<Bytes>) -> Self
pub fn ordering_key(self, key: impl Into<Bytes>) -> Self
Set the ordering key. See OutgoingMessage::ordering_key.
Sourcepub fn event_time_ms(self, ts: u64) -> Self
pub fn event_time_ms(self, ts: u64) -> Self
Set the event time (millis since epoch). See OutgoingMessage::event_time_ms.
Sourcepub fn property(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn property(self, key: impl Into<String>, value: impl Into<String>) -> Self
Append a property. See OutgoingMessage::property.
Sourcepub fn deliver_at_ms(self, ts_ms: i64) -> Self
pub fn deliver_at_ms(self, ts_ms: i64) -> Self
Sourcepub fn deliver_after_ms(self, now_ms: i64, delay_ms: i64) -> Self
pub fn deliver_after_ms(self, now_ms: i64, delay_ms: i64) -> Self
See OutgoingMessage::deliver_after_ms. The caller supplies
now_ms (sans-io, ADR-0011 invariant #3); the engine convenience
methods snapshot the host wall clock on the tokio path and the
virtual wall clock on the moonpool path.
Sourcepub fn replication_clusters(self, clusters: Vec<String>) -> Self
pub fn replication_clusters(self, clusters: Vec<String>) -> Self
Sourcepub fn disable_replication(self) -> Self
pub fn disable_replication(self) -> Self
Sourcepub fn txn(self, txn_id: TxnId) -> Self
pub fn txn(self, txn_id: TxnId) -> Self
See OutgoingMessage::txn.
Sourcepub fn value(self, payload: impl Into<Bytes>) -> Self
pub fn value(self, payload: impl Into<Bytes>) -> Self
Set the payload bytes. See OutgoingMessage::value.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Freeze for MessageBuilder<'a>
impl<'a> !RefUnwindSafe for MessageBuilder<'a>
impl<'a> !UnwindSafe for MessageBuilder<'a>
impl<'a> Send for MessageBuilder<'a>
impl<'a> Sync for MessageBuilder<'a>
impl<'a> Unpin for MessageBuilder<'a>
impl<'a> UnsafeUnpin for MessageBuilder<'a>
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