Skip to content

stdlib/swiftView source ↗

swift

33 items · generated by scribe fromstdlib/swift.fd· synced 2026-11-15

stdlib/swift33 items

Contents

SWIFT_MT103:

pub const SWIFT_MT103: i64 = 103;  // Customer Credit Transfer

Defined at line 25


SWIFT_MT202:

pub const SWIFT_MT202: i64 = 202;  // General Financial Institution Transfer

Defined at line 26


SWIFT_MT900:

pub const SWIFT_MT900: i64 = 900;  // Confirmation of Debit

Defined at line 27


SWIFT_MT910:

pub const SWIFT_MT910: i64 = 910;  // Confirmation of Credit

Defined at line 28


SWIFT_MT940:

pub const SWIFT_MT940: i64 = 940;  // Statement Message

Defined at line 29


SWIFT_MT942:

pub const SWIFT_MT942: i64 = 942;  // Interim Transaction Report

Defined at line 30


SWIFT_MT199:

pub const SWIFT_MT199: i64 = 199;  // Free Format Message

Defined at line 31


SWIFT_MT299:

pub const SWIFT_MT299: i64 = 299;  // Free Format Message (FIN)

Defined at line 32


SWIFT_MT300:

pub const SWIFT_MT300: i64 = 300;  // Foreign Exchange Confirmation

Defined at line 33


SWIFT_MT320:

pub const SWIFT_MT320: i64 = 320;  // Loan/Deposit Confirmation

Defined at line 34


SWIFT_MT700:

pub const SWIFT_MT700: i64 = 700;  // Issue of a Documentary Credit

Defined at line 35


SWIFT_MT760:

pub const SWIFT_MT760: i64 = 760;  // Guarantee

Defined at line 36


swift_mt_name

Get SWIFT message type name.

pub fn swift_mt_name(mt: i64) -> str {

Parameters:

  • mt: i64

Returns: str

Defined at line 39


swift_bic_validate

Validate a BIC code (8 or 11 characters).

pub fn swift_bic_validate(bic: str) -> bool {

Parameters:

  • bic: str

Returns: bool

Defined at line 89


swift_bic_bank_code

Get the bank code (first 4 characters) from a BIC.

pub fn swift_bic_bank_code(bic: str) -> str {

Parameters:

  • bic: str

Returns: str

Defined at line 105


swift_bic_country

Get the country code (characters 5-6) from a BIC.

pub fn swift_bic_country(bic: str) -> str {

Parameters:

  • bic: str

Returns: str

Defined at line 110


swift_bic_location

Get the location code (characters 7-8) from a BIC.

pub fn swift_bic_location(bic: str) -> str {

Parameters:

  • bic: str

Returns: str

Defined at line 115


swift_bic_branch

Get the branch code (characters 9-11) from a BIC. Returns “XXX” if not present (primary office).

pub fn swift_bic_branch(bic: str) -> str {

Parameters:

  • bic: str

Returns: str

Defined at line 121


swift_iban_validate_length

Validate IBAN length by country code.

pub fn swift_iban_validate_length(iban: str) -> bool {

Parameters:

  • iban: str

Returns: bool

Defined at line 135


swift_iban_country

Get country code from IBAN.

pub fn swift_iban_country(iban: str) -> str {

Parameters:

  • iban: str

Returns: str

Defined at line 192


swift_iban_check_digits

Get check digits from IBAN (characters 3-4).

pub fn swift_iban_check_digits(iban: str) -> str {

Parameters:

  • iban: str

Returns: str

Defined at line 197


swift_iban_bban

Get BBAN (Basic Bank Account Number) from IBAN (characters 5+).

pub fn swift_iban_bban(iban: str) -> str {

Parameters:

  • iban: str

Returns: str

Defined at line 202


MT103

An MT103 message structure.

pub struct MT103 {

Fields:

NameType
sender_bicstr
receiver_bicstr
message_idstr
amounti64
currencystr
ordering_customerstr
beneficiary_customerstr
ordering_institutionstr
beneficiary_institutionstr
remittance_infostr
value_datestr

Defined at line 212


swift_mt103_new

Create a new MT103 message.

pub fn swift_mt103_new(sender_bic: str, receiver_bic: str, amount_cents: i64, currency: str) -> MT103 {

Parameters:

  • sender_bic: str
  • receiver_bic: str
  • amount_cents: i64
  • currency: str

Returns: MT103

Defined at line 229


swift_mt103_set_ordering

Set ordering customer (party initiating the payment).

pub fn swift_mt103_set_ordering(msg: & mut MT103, customer: str, institution: str) -> void {

Parameters:

  • msg: & mut MT103
  • customer: str
  • institution: str

Returns: void

Defined at line 236


swift_mt103_set_beneficiary

Set beneficiary customer (party receiving the payment).

pub fn swift_mt103_set_beneficiary(msg: & mut MT103, customer: str, institution: str) -> void {

Parameters:

  • msg: & mut MT103
  • customer: str
  • institution: str

Returns: void

Defined at line 242


swift_mt103_set_remittance

Set remittance information (payment reference).

pub fn swift_mt103_set_remittance(msg: & mut MT103, info: str) -> void {

Parameters:

  • msg: & mut MT103
  • info: str

Returns: void

Defined at line 248


swift_mt103_set_value_date

Set value date (YYMMDD format).

pub fn swift_mt103_set_value_date(msg: & mut MT103, date: str) -> void {

Parameters:

  • msg: & mut MT103
  • date: str

Returns: void

Defined at line 253


swift_mt103_serialize

Serialize an MT103 message to SWIFT text format.

pub fn swift_mt103_serialize(msg: MT103) -> str {

Parameters:

  • msg: MT103

Returns: str

Defined at line 258


swift_mt103_amount_major

Get the amount in major currency units (e.g. dollars, not cents).

pub fn swift_mt103_amount_major(msg: MT103) -> f64 {

Parameters:

  • msg: MT103

Returns: f64

Defined at line 299


swift_mt103_amount_formatted

Get the amount as a formatted string (e.g. “1000.00 USD”).

pub fn swift_mt103_amount_formatted(msg: MT103) -> str {

Parameters:

  • msg: MT103

Returns: str

Defined at line 304


swift_parse_field

Parse a field tag and value from a SWIFT text line. Format: “:TAG:VALUE” (e.g. “:20:REF12345”) Returns (tag, value) as a Vec [tag_str, value_str].

pub fn swift_parse_field(line: str) -> Vec<str> {

Parameters:

  • line: str

Returns: Vec<str>

Defined at line 320


swift_extract_field

Extract a specific field from a SWIFT text block. Returns the field value, or "" if not found.

pub fn swift_extract_field(text: str, tag: str) -> str {

Parameters:

  • text: str
  • tag: str

Returns: str

Defined at line 356


Generated by scribe, the Fides documentation generator