Module utils

Module utils 

Source

Functions§

append_field
Append a mandatory field to the result string with CRLF.
append_optional_field
Append an optional field to the result string with CRLF if present.
append_vec_field
Append a vector of fields to the result string, each with CRLF.
extract_block4
Extract Block 4 content from SWIFT message input. If input starts with “{”, attempts to extract Block 4. Otherwise, assumes input is already Block 4 content.
finalize_mt_string
Finalize MT string by removing trailing CRLF and optionally adding terminator.
parse_repeated_field
Parse repeated fields and return as Option<Vec>. Returns None if no fields found, Some(vec) otherwise.
remove_trailing_crlf
Remove trailing CRLF from result string if present.
verify_parser_complete
Verify that all content in the parser has been consumed. Returns error if unparsed content remains.