pub struct MessageParser<'a> { /* private fields */ }
Expand description
Message parser that tracks position while parsing SWIFT messages
Implementations§
Source§impl<'a> MessageParser<'a>
impl<'a> MessageParser<'a>
Sourcepub fn with_duplicates(self, allow: bool) -> Self
pub fn with_duplicates(self, allow: bool) -> Self
Enable or disable duplicate field handling
Sourcepub fn parse_field<T: SwiftField>(&mut self, tag: &str) -> Result<T, ParseError>
pub fn parse_field<T: SwiftField>(&mut self, tag: &str) -> Result<T, ParseError>
Parse a required field
Sourcepub fn parse_optional_field<T: SwiftField>(
&mut self,
tag: &str,
) -> Result<Option<T>, ParseError>
pub fn parse_optional_field<T: SwiftField>( &mut self, tag: &str, ) -> Result<Option<T>, ParseError>
Parse an optional field (only checks immediate next field, not searching ahead)
Sourcepub fn parse_repeated_field<T: SwiftField>(
&mut self,
tag: &str,
) -> Result<Vec<T>, ParseError>
pub fn parse_repeated_field<T: SwiftField>( &mut self, tag: &str, ) -> Result<Vec<T>, ParseError>
Parse a repeated field (returns Vec)
Sourcepub fn parse_variant_field<T: SwiftField>(
&mut self,
base_tag: &str,
) -> Result<T, ParseError>
pub fn parse_variant_field<T: SwiftField>( &mut self, base_tag: &str, ) -> Result<T, ParseError>
Parse a field with variant detection (for enum fields)
Sourcepub fn parse_optional_variant_field<T: SwiftField>(
&mut self,
base_tag: &str,
) -> Result<Option<T>, ParseError>
pub fn parse_optional_variant_field<T: SwiftField>( &mut self, base_tag: &str, ) -> Result<Option<T>, ParseError>
Parse an optional field with variant detection
Sourcepub fn detect_variant_optional(&self, base_tag: &str) -> Option<String>
pub fn detect_variant_optional(&self, base_tag: &str) -> Option<String>
Detect variant for optional fields
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if we’ve reached the end of input
Sourcepub fn detect_field(&self, tag: &str) -> bool
pub fn detect_field(&self, tag: &str) -> bool
Check if a field exists in the remaining content
Sourcepub fn peek_field_variant(&self, base_tag: &str) -> Option<String>
pub fn peek_field_variant(&self, base_tag: &str) -> Option<String>
Peek at the variant of a field without consuming it Returns the variant letter (e.g., “A”, “K”, “C”, “L”) if the field exists
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for MessageParser<'a>
impl<'a> RefUnwindSafe for MessageParser<'a>
impl<'a> Send for MessageParser<'a>
impl<'a> Sync for MessageParser<'a>
impl<'a> Unpin for MessageParser<'a>
impl<'a> UnwindSafe for MessageParser<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more