pub struct EdifactStreamParser;Expand description
Streaming EDIFACT parser.
Parses a byte slice by tokenizing it into segments and routing them
to an EdifactHandler. Service segments (UNB, UNH, UNT, UNZ) are
dispatched to specific handler methods in addition to on_segment().
Implementations§
Source§impl EdifactStreamParser
impl EdifactStreamParser
Sourcepub fn parse(
input: &[u8],
handler: &mut dyn EdifactHandler,
) -> Result<(), ParseError>
pub fn parse( input: &[u8], handler: &mut dyn EdifactHandler, ) -> Result<(), ParseError>
Parse an EDIFACT interchange from a byte slice.
This is the main synchronous entry point. It:
- Detects UNA and determines delimiters
- Tokenizes input into segments
- Routes each segment to the handler
- Stops if the handler returns
Control::Stop
Supports both UTF-8 and ISO-8859-1 encoded input. If the input contains non-UTF-8 bytes (raw ISO-8859-1), it is transparently transcoded to UTF-8 before parsing. EDIFACT delimiters are always ASCII, so transcoding does not affect delimiter detection.
Auto Trait Implementations§
impl Freeze for EdifactStreamParser
impl RefUnwindSafe for EdifactStreamParser
impl Send for EdifactStreamParser
impl Sync for EdifactStreamParser
impl Unpin for EdifactStreamParser
impl UnsafeUnpin for EdifactStreamParser
impl UnwindSafe for EdifactStreamParser
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