pub struct MessageExt {Show 15 fields
pub message: Message,
pub broker_name: CheetahString,
pub queue_id: i32,
pub store_size: i32,
pub queue_offset: i64,
pub sys_flag: i32,
pub born_timestamp: i64,
pub born_host: SocketAddr,
pub store_timestamp: i64,
pub store_host: SocketAddr,
pub msg_id: CheetahString,
pub commit_log_offset: i64,
pub body_crc: u32,
pub reconsume_times: i32,
pub prepared_transaction_offset: i64,
}Fields§
§message: Message§broker_name: CheetahString§queue_id: i32§store_size: i32§queue_offset: i64§sys_flag: i32§born_timestamp: i64§born_host: SocketAddr§store_timestamp: i64§store_host: SocketAddr§msg_id: CheetahString§commit_log_offset: i64§body_crc: u32§reconsume_times: i32§prepared_transaction_offset: i64Implementations§
Source§impl MessageExt
impl MessageExt
pub fn socket_address_2_byte_buffer(ip: &SocketAddr) -> Bytes
pub fn born_host_bytes(&self) -> Bytes
pub fn born_store_bytes(&self) -> Bytes
pub fn topic(&self) -> &CheetahString
pub fn born_host(&self) -> SocketAddr
pub fn store_host(&self) -> SocketAddr
pub fn with_born_host_v6_flag(&mut self)
pub fn with_store_host_v6_flag(&mut self)
pub fn body(&self) -> Option<Bytes>
pub fn sys_flag(&self) -> i32
pub fn body_crc(&self) -> u32
pub fn queue_id(&self) -> i32
pub fn flag(&self) -> i32
pub fn message_inner(&self) -> &Message
pub fn broker_name(&self) -> &str
pub fn store_size(&self) -> i32
pub fn queue_offset(&self) -> i64
pub fn born_timestamp(&self) -> i64
pub fn store_timestamp(&self) -> i64
pub fn msg_id(&self) -> &CheetahString
pub fn commit_log_offset(&self) -> i64
pub fn reconsume_times(&self) -> i32
pub fn prepared_transaction_offset(&self) -> i64
pub fn set_message_inner(&mut self, message_inner: Message)
pub fn set_broker_name(&mut self, broker_name: CheetahString)
pub fn set_queue_id(&mut self, queue_id: i32)
pub fn set_store_size(&mut self, store_size: i32)
pub fn set_queue_offset(&mut self, queue_offset: i64)
pub fn set_sys_flag(&mut self, sys_flag: i32)
pub fn set_born_timestamp(&mut self, born_timestamp: i64)
pub fn set_born_host(&mut self, born_host: SocketAddr)
pub fn set_store_timestamp(&mut self, store_timestamp: i64)
pub fn set_store_host(&mut self, store_host: SocketAddr)
pub fn set_msg_id(&mut self, msg_id: CheetahString)
pub fn set_commit_log_offset(&mut self, commit_log_offset: i64)
pub fn set_body_crc(&mut self, body_crc: u32)
pub fn set_reconsume_times(&mut self, reconsume_times: i32)
pub fn set_prepared_transaction_offset( &mut self, prepared_transaction_offset: i64, )
pub fn properties(&self) -> &HashMap<CheetahString, CheetahString>
Methods from Deref<Target = Message>§
pub fn set_keys(&mut self, keys: CheetahString)
pub fn clear_property(&mut self, name: impl Into<CheetahString>)
pub fn set_properties( &mut self, properties: HashMap<CheetahString, CheetahString>, )
pub fn get_property(&self, key: &CheetahString) -> Option<CheetahString>
pub fn body(&self) -> Option<Bytes>
pub fn flag(&self) -> i32
pub fn topic(&self) -> &CheetahString
pub fn properties(&self) -> &MessageProperties
pub fn transaction_id(&self) -> Option<&str>
pub fn get_transaction_id(&self) -> Option<&CheetahString>
pub fn is_wait_store_msg_ok(&self) -> bool
pub fn delay_time_level(&self) -> i32
pub fn set_delay_time_level(&mut self, level: i32)
pub fn get_user_property( &self, name: impl Into<CheetahString>, ) -> Option<CheetahString>
pub fn as_any(&self) -> &dyn Any
pub fn set_instance_id(&mut self, instance_id: impl Into<CheetahString>)
Sourcepub fn body_slice(&self) -> &[u8] ⓘ
pub fn body_slice(&self) -> &[u8] ⓘ
Returns the message body as a byte slice (borrows).
This is the recommended way to access the message body.
Returns the message tags.
Sourcepub fn message_flag(&self) -> MessageFlag
pub fn message_flag(&self) -> MessageFlag
Returns the message flag as a type-safe MessageFlag.
Sourcepub fn wait_store_msg_ok(&self) -> bool
pub fn wait_store_msg_ok(&self) -> bool
Returns whether to wait for store confirmation.
Sourcepub fn delay_level(&self) -> i32
pub fn delay_level(&self) -> i32
Returns the delay time level.
Sourcepub fn instance_id(&self) -> Option<&str>
pub fn instance_id(&self) -> Option<&str>
Returns the instance ID.
Trait Implementations§
Source§impl Clone for MessageExt
impl Clone for MessageExt
Source§fn clone(&self) -> MessageExt
fn clone(&self) -> MessageExt
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MessageExt
impl Debug for MessageExt
Source§impl Default for MessageExt
impl Default for MessageExt
Source§impl Deref for MessageExt
impl Deref for MessageExt
Source§impl DerefMut for MessageExt
impl DerefMut for MessageExt
Source§impl Display for MessageExt
impl Display for MessageExt
Source§impl From<MessageEnvelope> for MessageExt
impl From<MessageEnvelope> for MessageExt
Source§fn from(envelope: MessageEnvelope) -> Self
fn from(envelope: MessageEnvelope) -> Self
Converts to this type from the input type.
Source§impl From<MessageExt> for MessageEnvelope
impl From<MessageExt> for MessageEnvelope
Source§fn from(ext: MessageExt) -> Self
fn from(ext: MessageExt) -> Self
Converts to this type from the input type.
Source§impl MessageTrait for MessageExt
impl MessageTrait for MessageExt
Source§fn put_property(&mut self, key: CheetahString, value: CheetahString)
fn put_property(&mut self, key: CheetahString, value: CheetahString)
Adds a property to the message.
Source§fn clear_property(&mut self, name: &str)
fn clear_property(&mut self, name: &str)
Removes the specified property from the message.
Source§fn property(&self, name: &CheetahString) -> Option<CheetahString>
fn property(&self, name: &CheetahString) -> Option<CheetahString>
Retrieves a property value.
Source§fn property_ref(&self, name: &CheetahString) -> Option<&CheetahString>
fn property_ref(&self, name: &CheetahString) -> Option<&CheetahString>
Retrieves a reference to a property value.
Source§fn topic(&self) -> &CheetahString
fn topic(&self) -> &CheetahString
Returns the topic of the message.
Source§fn set_topic(&mut self, topic: CheetahString)
fn set_topic(&mut self, topic: CheetahString)
Sets the topic for the message.
Source§fn get_properties(&self) -> &HashMap<CheetahString, CheetahString>
fn get_properties(&self) -> &HashMap<CheetahString, CheetahString>
Returns all properties associated with the message.
Source§fn set_properties(&mut self, properties: HashMap<CheetahString, CheetahString>)
fn set_properties(&mut self, properties: HashMap<CheetahString, CheetahString>)
Sets multiple properties for the message.
Source§fn transaction_id(&self) -> Option<&CheetahString>
fn transaction_id(&self) -> Option<&CheetahString>
Retrieves the transaction ID associated with the message. Read more
Source§fn set_transaction_id(&mut self, transaction_id: CheetahString)
fn set_transaction_id(&mut self, transaction_id: CheetahString)
Sets the transaction ID for the message.
Source§fn get_compressed_body_mut(&mut self) -> Option<&mut Bytes>
fn get_compressed_body_mut(&mut self) -> Option<&mut Bytes>
Returns a mutable reference to the compressed body of the message.
Source§fn get_compressed_body(&self) -> Option<&Bytes>
fn get_compressed_body(&self) -> Option<&Bytes>
Returns a reference to the compressed body of the message.
Source§fn set_compressed_body_mut(&mut self, compressed_body: Bytes)
fn set_compressed_body_mut(&mut self, compressed_body: Bytes)
Sets the compressed body of the message.
Source§fn take_body(&mut self) -> Option<Bytes>
fn take_body(&mut self) -> Option<Bytes>
Takes ownership of the message body, leaving it empty.
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Returns a mutable reference to the message as a trait object.
Source§fn set_keys(&mut self, keys: CheetahString)
fn set_keys(&mut self, keys: CheetahString)
Sets the keys for the message.
Source§fn put_user_property(
&mut self,
name: CheetahString,
value: CheetahString,
) -> RocketMQResult<()>
fn put_user_property( &mut self, name: CheetahString, value: CheetahString, ) -> RocketMQResult<()>
Adds a user-defined property to the message. Read more
Source§fn user_property(&self, name: &CheetahString) -> Option<CheetahString>
fn user_property(&self, name: &CheetahString) -> Option<CheetahString>
Retrieves a user-defined property value.
Source§fn user_property_ref(&self, name: &CheetahString) -> Option<&CheetahString>
fn user_property_ref(&self, name: &CheetahString) -> Option<&CheetahString>
Retrieves a reference to a user-defined property value.
Returns the tags associated with the message.
Returns a reference to the tags associated with the message.
Sets the tags for the message.
Source§fn get_keys(&self) -> Option<CheetahString>
fn get_keys(&self) -> Option<CheetahString>
Returns the keys associated with the message.
Source§fn get_keys_ref(&self) -> Option<&CheetahString>
fn get_keys_ref(&self) -> Option<&CheetahString>
Returns a reference to the keys associated with the message.
Source§fn set_keys_from_collection(&mut self, key_collection: Vec<String>)
fn set_keys_from_collection(&mut self, key_collection: Vec<String>)
Sets the message keys from a collection, joining them with spaces.
Source§fn delay_time_level(&self) -> i32
fn delay_time_level(&self) -> i32
Returns the delay time level of the message, or 0 if not set.
Source§fn set_delay_time_level(&mut self, level: i32)
fn set_delay_time_level(&mut self, level: i32)
Sets the delay time level for the message.
Source§fn is_wait_store_msg_ok(&self) -> bool
fn is_wait_store_msg_ok(&self) -> bool
Returns whether the message should wait for store acknowledgment. Read more
Source§fn set_wait_store_msg_ok(&mut self, wait_store_msg_ok: bool)
fn set_wait_store_msg_ok(&mut self, wait_store_msg_ok: bool)
Sets whether the message should wait for store acknowledgment.
Source§fn set_instance_id(&mut self, instance_id: CheetahString)
fn set_instance_id(&mut self, instance_id: CheetahString)
Sets the instance ID for the message.
Source§fn buyer_id(&self) -> Option<CheetahString>
fn buyer_id(&self) -> Option<CheetahString>
Returns the buyer ID associated with the message.
Source§fn buyer_id_ref(&self) -> Option<&CheetahString>
fn buyer_id_ref(&self) -> Option<&CheetahString>
Returns a reference to the buyer ID associated with the message.
Source§fn set_buyer_id(&mut self, buyer_id: CheetahString)
fn set_buyer_id(&mut self, buyer_id: CheetahString)
Sets the buyer ID for the message.
Source§fn set_delay_time_sec(&mut self, sec: u64)
fn set_delay_time_sec(&mut self, sec: u64)
Sets the delay time for the message in seconds.
Source§fn get_delay_time_sec(&self) -> u64
fn get_delay_time_sec(&self) -> u64
Returns the delay time for the message in seconds, or 0 if not set.
Source§fn set_delay_time_ms(&mut self, time_ms: u64)
fn set_delay_time_ms(&mut self, time_ms: u64)
Sets the delay time for the message in milliseconds.
Source§fn get_delay_time_ms(&self) -> u64
fn get_delay_time_ms(&self) -> u64
Returns the delay time for the message in milliseconds, or 0 if not set.
Source§fn set_deliver_time_ms(&mut self, time_ms: u64)
fn set_deliver_time_ms(&mut self, time_ms: u64)
Sets the delivery time for the message in milliseconds.
Source§fn get_deliver_time_ms(&self) -> u64
fn get_deliver_time_ms(&self) -> u64
Returns the delivery time for the message in milliseconds, or 0 if not set.
Auto Trait Implementations§
impl !Freeze for MessageExt
impl RefUnwindSafe for MessageExt
impl Send for MessageExt
impl Sync for MessageExt
impl Unpin for MessageExt
impl UnsafeUnpin for MessageExt
impl UnwindSafe for MessageExt
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§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.