pub struct MsgMeta {
pub tx: String,
pub rx: String,
pub key: String,
pub kind: MsgKind,
pub correlation_id: Uuid,
pub route: Route,
pub payload_size: u64,
pub auth_token: Option<String>,
pub auth_data: Option<Value>,
pub attachments: Vec<Attachment>,
}Expand description
Message meta data. Message passing protocol is build around this structure.
Fields§
§tx: StringAddr of message sender
rx: StringAddr of message receiver
key: StringLogic key for message processing
kind: MsgKindDefines what kind of message it is
correlation_id: UuidCorrelation id is needed for rpc and for message chains
route: RouteLogical message route, receiver are responsible for moving message on.
payload_size: u64Size of payload, used for deserialization. Also useful for monitoring.
auth_token: Option<String>Authorization token.
auth_data: Option<Value>Authorization data.
attachments: Vec<Attachment>Attachments to message
Implementations§
Source§impl MsgMeta
impl MsgMeta
Sourcepub fn content_len(&self) -> u64
pub fn content_len(&self) -> u64
Payload plus attachments len.
Sourcepub fn attachments_len(&self) -> u64
pub fn attachments_len(&self) -> u64
Attachments len.
Sourcepub fn attachments_sizes(&self) -> Vec<u64>
pub fn attachments_sizes(&self) -> Vec<u64>
Attachments sizes.
Sourcepub fn key_part(&self, index: usize) -> Result<&str, String>
pub fn key_part(&self, index: usize) -> Result<&str, String>
Get key part, index is zero based, . is used as a separator.
Sourcepub fn match_key_part(&self, index: usize, value: &str) -> Result<bool, String>
pub fn match_key_part(&self, index: usize, value: &str) -> Result<bool, String>
Compares key part with passed value, index is zero based, . is used as a separator.
Sourcepub fn tx_part(&self, index: usize) -> Result<&str, String>
pub fn tx_part(&self, index: usize) -> Result<&str, String>
Get tx part, index is zero based, . is used as a separator.
Sourcepub fn match_tx_part(&self, index: usize, value: &str) -> Result<bool, String>
pub fn match_tx_part(&self, index: usize, value: &str) -> Result<bool, String>
Compares tx part with passed value, index is zero based, . is used as a separator.
pub fn source_cmp_addr(&self) -> Option<&str>
Sourcepub fn source_cmp_part(&self, index: usize) -> Result<&str, String>
pub fn source_cmp_part(&self, index: usize) -> Result<&str, String>
Get source cmp part, index is zero based, . is used as a separator.
Sourcepub fn match_source_cmp_part(
&self,
index: usize,
value: &str,
) -> Result<bool, String>
pub fn match_source_cmp_part( &self, index: usize, value: &str, ) -> Result<bool, String>
Compares source cmp part with passed value, index is zero based, . is used as a separator.
Sourcepub fn source_cmp_part_before_last(&self) -> Result<&str, String>
pub fn source_cmp_part_before_last(&self) -> Result<&str, String>
Get source cmp part before last one, . is used as a separator.