pub struct RawMessage {
pub data: Vec<u8>,
pub metadata: MessageMetadata,
}Expand description
原始消息 (字节形式)
Fields§
§data: Vec<u8>消息数据
metadata: MessageMetadata消息元数据
Implementations§
Source§impl RawMessage
impl RawMessage
Sourcepub fn with_correlation_id(self, id: impl Into<String>) -> Self
pub fn with_correlation_id(self, id: impl Into<String>) -> Self
设置关联 ID
Sourcepub fn with_reply_to(self, queue: impl Into<String>) -> Self
pub fn with_reply_to(self, queue: impl Into<String>) -> Self
设置回复队列
Sourcepub fn with_priority(self, priority: u8) -> Self
pub fn with_priority(self, priority: u8) -> Self
设置优先级
Sourcepub fn with_expiration(self, ms: u64) -> Self
pub fn with_expiration(self, ms: u64) -> Self
设置过期时间
Source§impl RawMessage
impl RawMessage
Sourcepub fn into_typed<T: DeserializeOwned>(self) -> WaeResult<Message<T>>
pub fn into_typed<T: DeserializeOwned>(self) -> WaeResult<Message<T>>
反序列化为泛型消息
Trait Implementations§
Source§impl Clone for RawMessage
impl Clone for RawMessage
Source§fn clone(&self) -> RawMessage
fn clone(&self) -> RawMessage
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 moreAuto Trait Implementations§
impl Freeze for RawMessage
impl RefUnwindSafe for RawMessage
impl Send for RawMessage
impl Sync for RawMessage
impl Unpin for RawMessage
impl UnsafeUnpin for RawMessage
impl UnwindSafe for RawMessage
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