pub struct PriorityMessage {
pub message_id: String,
pub priority: Priority,
pub payload: Vec<u8>,
pub headers: HashMap<String, String>,
pub timestamp: DateTime<Utc>,
pub expiry: Option<DateTime<Utc>>,
pub retry_count: u32,
pub max_retries: u32,
}Expand description
Priority message with metadata
Fields§
§message_id: String§priority: Priority§payload: Vec<u8>§headers: HashMap<String, String>§timestamp: DateTime<Utc>§expiry: Option<DateTime<Utc>>§retry_count: u32§max_retries: u32Implementations§
Source§impl PriorityMessage
impl PriorityMessage
pub fn new(payload: Vec<u8>, priority: Priority) -> Self
pub fn with_expiry(self, expiry: DateTime<Utc>) -> Self
pub fn with_header(self, key: String, value: String) -> Self
pub fn with_max_retries(self, max_retries: u32) -> Self
pub fn is_expired(&self) -> bool
pub fn can_retry(&self) -> bool
pub fn increment_retry(&mut self)
Trait Implementations§
Source§impl Clone for PriorityMessage
impl Clone for PriorityMessage
Source§fn clone(&self) -> PriorityMessage
fn clone(&self) -> PriorityMessage
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 PriorityMessage
impl Debug for PriorityMessage
Source§impl<'de> Deserialize<'de> for PriorityMessage
impl<'de> Deserialize<'de> for PriorityMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PriorityMessage
impl RefUnwindSafe for PriorityMessage
impl Send for PriorityMessage
impl Sync for PriorityMessage
impl Unpin for PriorityMessage
impl UnwindSafe for PriorityMessage
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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