Skip to main content

LightMessage

Struct LightMessage 

Source
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

Source

pub fn message_type_code(&self) -> &str

Raw EDIFACT message type code from UNH S009 DE 0065 (e.g. "UTILMD").

Source

pub fn try_message_type(&self) -> Option<MessageType>

Parsed MessageType discriminant, or None for unknown types.

Source

pub fn assoc_code(&self) -> &str

Association assigned code from UNH S009 DE 0057 (e.g. "S2.1", "2.4c").

Source

pub fn release(&self) -> Release

Parsed Release derived from assoc_code.

Source

pub fn message_ref(&self) -> &str

UNH message reference (DE 0062).

Source

pub fn pruefidentifikator(&self) -> Option<Pruefidentifikator>

Prüfidentifikator extracted from BGM or RFF+Z13, if present.

Source

pub fn segments(&self) -> &[OwnedSegment]

Raw segment slice. Available for advanced callers that need to inspect specific segments without upgrading to a full AnyMessage.

Source

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.

Trait Implementations§

Source§

impl Debug for LightMessage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.