pub struct MessageBuilder { /* private fields */ }Expand description
Builder for creating messages with custom settings.
Implementations§
Source§impl MessageBuilder
impl MessageBuilder
Sourcepub fn new(sender: UserId, recipient: UserId, app_id: AppId) -> Self
pub fn new(sender: UserId, recipient: UserId, app_id: AppId) -> Self
Creates a new message builder.
Sourcepub fn content_type(self, content_type: ContentType) -> Self
pub fn content_type(self, content_type: ContentType) -> Self
Sets the content type.
Sourcepub fn media_metadata(self, meta: MediaMetadata) -> Self
pub fn media_metadata(self, meta: MediaMetadata) -> Self
Sets the media metadata.
Sourcepub fn priority(self, priority: MessagePriority) -> Self
pub fn priority(self, priority: MessagePriority) -> Self
Sets the message priority.
Sourcepub fn metadata(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn metadata(self, key: impl Into<String>, value: impl Into<String>) -> Self
Adds metadata to the message.
Sourcepub fn requires_ack(self, requires_ack: bool) -> Self
pub fn requires_ack(self, requires_ack: bool) -> Self
Sets whether the message requires an ACK.
Sourcepub fn reply_to_msg(self, reply_to: MessageId) -> Self
pub fn reply_to_msg(self, reply_to: MessageId) -> Self
Sets the message this is replying to.
Sourcepub fn forwarded_from(self, info: ForwardInfo) -> Self
pub fn forwarded_from(self, info: ForwardInfo) -> Self
Sets forwarding attribution on the message.
Sourcepub fn reply_context(self, ctx: ReplyContext) -> Self
pub fn reply_context(self, ctx: ReplyContext) -> Self
Sets the quoted-reply context on the message.
Sourcepub fn lamport_clock(self, clock: LamportClock) -> Self
pub fn lamport_clock(self, clock: LamportClock) -> Self
Sets the Lamport clock value for this message.
Auto Trait Implementations§
impl Freeze for MessageBuilder
impl RefUnwindSafe for MessageBuilder
impl Send for MessageBuilder
impl Sync for MessageBuilder
impl Unpin for MessageBuilder
impl UnsafeUnpin for MessageBuilder
impl UnwindSafe for MessageBuilder
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