pub struct Message {
pub topic: CheetahString,
pub flag: i32,
pub properties: HashMap<CheetahString, CheetahString>,
pub body: Option<Bytes>,
pub compressed_body: Option<Bytes>,
pub transaction_id: Option<CheetahString>,
}
Fields§
§topic: CheetahString
§flag: i32
§properties: HashMap<CheetahString, CheetahString>
§body: Option<Bytes>
§compressed_body: Option<Bytes>
§transaction_id: Option<CheetahString>
Implementations§
Source§impl Message
impl Message
pub fn new(topic: impl Into<CheetahString>, body: &[u8]) -> Self
pub fn new_body(topic: impl Into<CheetahString>, body: Option<Bytes>) -> Self
pub fn with_keys( topic: impl Into<CheetahString>, tags: impl Into<CheetahString>, keys: impl Into<CheetahString>, body: &[u8], ) -> Self
pub fn with_details( topic: impl Into<CheetahString>, tags: impl Into<CheetahString>, keys: impl Into<CheetahString>, flag: i32, body: &[u8], wait_store_msg_ok: bool, ) -> Self
pub fn with_details_body( topic: impl Into<CheetahString>, tags: impl Into<CheetahString>, keys: impl Into<CheetahString>, flag: i32, body: Option<Bytes>, wait_store_msg_ok: bool, ) -> Self
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) -> &HashMap<CheetahString, CheetahString>
pub fn transaction_id(&self) -> Option<&str>
pub fn is_wait_store_msg_ok(&self) -> bool
pub fn get_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>)
Trait Implementations§
Source§impl MessageTrait for Message
impl MessageTrait for Message
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. Read more
Source§fn clear_property(&mut self, name: &str)
fn clear_property(&mut self, name: &str)
Clears a specific property from the message. Read more
Source§fn get_property(&self, name: &CheetahString) -> Option<CheetahString>
fn get_property(&self, name: &CheetahString) -> Option<CheetahString>
Retrieves a property from the message. Read more
Source§fn get_topic(&self) -> &CheetahString
fn get_topic(&self) -> &CheetahString
Retrieves the topic of the message. Read more
Source§fn set_topic(&mut self, topic: CheetahString)
fn set_topic(&mut self, topic: CheetahString)
Sets the topic for the message. Read more
Source§fn get_properties(&self) -> &HashMap<CheetahString, CheetahString>
fn get_properties(&self) -> &HashMap<CheetahString, CheetahString>
Retrieves all properties associated with the message. Read more
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. Read more
Source§fn get_transaction_id(&self) -> Option<&CheetahString>
fn get_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. Read more
fn get_compressed_body_mut(&mut self) -> &mut Option<Bytes>
fn get_compressed_body(&self) -> Option<&Bytes>
fn set_compressed_body_mut(&mut self, compressed_body: Bytes)
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Converts the message into a mutable dynamic
Any
type. Read moreSource§fn set_keys(&mut self, keys: CheetahString)
fn set_keys(&mut self, keys: CheetahString)
Sets the keys for the message. Read more
Source§fn put_user_property(&mut self, name: CheetahString, value: CheetahString)
fn put_user_property(&mut self, name: CheetahString, value: CheetahString)
Adds a user-defined property to the message. Read more
Source§fn get_user_property(&self, name: &CheetahString) -> Option<CheetahString>
fn get_user_property(&self, name: &CheetahString) -> Option<CheetahString>
Retrieves a user-defined property from the message. Read more
Retrieves the tags associated with the message. Read more
Sets the tags for the message. Read more
Source§fn get_keys(&self) -> Option<CheetahString>
fn get_keys(&self) -> Option<CheetahString>
Retrieves the keys associated with the message. Read more
Source§fn set_keys_from_collection(&mut self, key_collection: Vec<String>)
fn set_keys_from_collection(&mut self, key_collection: Vec<String>)
Sets multiple keys from a collection for the message. Read more
Source§fn get_delay_time_level(&self) -> i32
fn get_delay_time_level(&self) -> i32
Retrieves the delay time level of the message. Read more
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. Read more
Source§fn is_wait_store_msg_ok(&self) -> bool
fn is_wait_store_msg_ok(&self) -> bool
Checks if 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. Read more
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. Read more
Source§fn get_buyer_id(&self) -> Option<CheetahString>
fn get_buyer_id(&self) -> Option<CheetahString>
Retrieves the buyer ID associated with the message. Read more
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. Read more
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. Read more
Source§fn get_delay_time_sec(&self) -> u64
fn get_delay_time_sec(&self) -> u64
Retrieves the delay time for the message in seconds. Read more
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. Read more
Source§fn get_delay_time_ms(&self) -> u64
fn get_delay_time_ms(&self) -> u64
Retrieves the delay time for the message in milliseconds. Read more
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. Read more
Source§fn get_deliver_time_ms(&self) -> u64
fn get_deliver_time_ms(&self) -> u64
Retrieves the delivery time for the message in milliseconds. Read more
Auto Trait Implementations§
impl !Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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