pub struct PrivateApplicationMessage {
pub version: Option<u8>,
pub kind: Option<String>,
pub app_id: Option<String>,
pub raw_json: String,
}Expand description
One Private Application Message received from an Encrypted Link.
This is the low-level receive item for the Private Application Message stream.
It keeps the raw plaintext payload so callers can route and persist messages
themselves. If decrypted bytes are not UTF-8, raw_json contains a local
invalid-JSON marker with the bytes encoded as base64url. Higher layers should
treat that marker as malformed input, not as a Private Application Message.
Fields§
§version: Option<u8>Private Application Message version from the JSON version field, when
the field is present and can be represented as a u8.
kind: Option<String>Message kind string from the JSON kind field, when the field is a
string.
app_id: Option<String>App ID string from the JSON app_id field, when the field is a string.
raw_json: StringRaw plaintext received over the Encrypted Link.
Implementations§
Source§impl PrivateApplicationMessage
impl PrivateApplicationMessage
Sourcepub fn known_kind(&self) -> Option<PrivateMessageKind>
pub fn known_kind(&self) -> Option<PrivateMessageKind>
Return the known Paykit kind from the raw payload, if this library can parse and recognize it.
Sourcepub fn invalid_utf8_error(&self) -> Option<&'static str>
pub fn invalid_utf8_error(&self) -> Option<&'static str>
Return a parse error for the local invalid-UTF-8 receive marker.
SDK/runtime callers use this to persist an audit/error record for a malformed stream item while still advancing the local Encrypted Link checkpoint. This is not expected on valid protocol messages.