pub struct LightMessage { /* private fields */ }Expand description
Envelope-only view of a parsed EDIFACT/EDI@Energy message.
See the module-level docs for a full description and the routing pattern.
Implementations§
Source§impl LightMessage
impl LightMessage
Sourcepub fn message_type_code(&self) -> &str
pub fn message_type_code(&self) -> &str
Raw EDIFACT message type code from UNH S009 DE 0065 (e.g. "UTILMD").
Sourcepub fn try_message_type(&self) -> Option<MessageType>
pub fn try_message_type(&self) -> Option<MessageType>
Parsed MessageType discriminant, or None for unknown types.
Sourcepub fn assoc_code(&self) -> &str
pub fn assoc_code(&self) -> &str
Association assigned code from UNH S009 DE 0057 (e.g. "S2.1", "2.4c").
Sourcepub fn release(&self) -> Release
pub fn release(&self) -> Release
Parsed Release derived from assoc_code.
Sourcepub fn message_ref(&self) -> &str
pub fn message_ref(&self) -> &str
UNH message reference (DE 0062).
Sourcepub fn pruefidentifikator(&self) -> Option<Pruefidentifikator>
pub fn pruefidentifikator(&self) -> Option<Pruefidentifikator>
Prüfidentifikator extracted from BGM or RFF+Z13, if present.
Sourcepub fn segments(&self) -> &[OwnedSegment]
pub fn segments(&self) -> &[OwnedSegment]
Raw segment slice. Available for advanced callers that need to inspect
specific segments without upgrading to a full AnyMessage.
Sourcepub fn into_message(self) -> Result<AnyMessage, Error>
pub fn into_message(self) -> Result<AnyMessage, Error>
Upgrade to a fully typed AnyMessage, performing typed field extraction.
The owned segment buffer is moved, so no re-allocation is required. The
additional cost is the typed field extraction pass (O(segments) work),
which is what routing-only paths avoid by holding a LightMessage.
§Errors
Returns Err when the message type is compiled out (FeatureNotEnabled)
or the UNH segment is malformed.