Struct Field23B

Source
pub struct Field23B {
    pub bank_operation_code: String,
}
Expand description

§Field 23B: Bank Operation Code

§Overview

Field 23B specifies the type of operation being performed in the SWIFT MT message. This field is mandatory in most MT messages and determines how the financial institution should process the transaction. The operation code influences routing, processing rules, and regulatory reporting requirements.

§Format Specification

Format: 4!c

  • 4!c: Exactly 4 alphabetic characters
  • Character set: A-Z (uppercase letters only)
  • Case handling: Automatically converted to uppercase
  • Validation: Must be exactly 4 characters, all alphabetic

§Standard Operation Codes

The most commonly used operation codes in SWIFT MT messages:

§Primary Codes

  • CRED: Credit Transfer - Standard customer credit transfer
  • CRTS: Credit Transfer Same Day - Same day credit transfer
  • SPAY: Supplementary Payment - Additional payment information
  • SSTD: Standing Order - Recurring payment instruction

§Extended Codes (Institution-specific)

  • SPRI: Special Priority - High priority processing
  • URGP: Urgent Payment - Expedited processing required
  • RTGS: Real Time Gross Settlement - RTGS system processing
  • NETS: Net Settlement - Net settlement processing

§Usage Context

Field 23B is used in numerous SWIFT MT message types:

  • MT103: Single Customer Credit Transfer
  • MT202: General Financial Institution Transfer
  • MT202COV: Cover for customer credit transfer
  • MT205: Financial Institution Transfer for its Own Account
  • MT210: Notice to Receive

§Business Applications

  • Payment routing: Determines processing path and priority
  • STP processing: Enables straight-through processing rules
  • Regulatory compliance: Affects reporting and monitoring
  • Fee calculation: May influence pricing and charges
  • Risk management: Impacts fraud detection and AML screening
  • Settlement timing: Affects when funds are made available

§Processing Rules

Different operation codes trigger specific processing behaviors:

§CRED (Credit Transfer)

  • Standard processing timeline
  • Normal priority in payment queues
  • Standard regulatory reporting
  • Typical settlement timing

§CRTS (Credit Transfer Same Day)

  • Expedited processing required
  • Higher priority in payment queues
  • Same-day settlement mandate
  • Enhanced monitoring and tracking

§SPAY (Supplementary Payment)

  • Additional payment details provided
  • May require manual review
  • Enhanced compliance checking
  • Detailed audit trail required

§SSTD (Standing Order)

  • Recurring payment processing
  • Template-based validation
  • Automated scheduling
  • Long-term relationship tracking

§Validation Rules

  1. Length: Must be exactly 4 characters
  2. Character set: Only alphabetic characters (A-Z)
  3. Case: Automatically normalized to uppercase
  4. Standards compliance: Should use recognized codes
  5. Business rules: Must align with message type and context

§Network Validated Rules (SWIFT Standards)

  • Operation code must be exactly 4 alphabetic characters (Error: T26)
  • Must contain only valid SWIFT character set (Error: T61)
  • Should be a recognized operation code (Warning: recommended practice)
  • Must be consistent with message type (Error: T40)

§Examples

:23B:CRED
└─── Standard credit transfer

:23B:CRTS
└─── Same day credit transfer

:23B:SPAY
└─── Supplementary payment

:23B:SSTD
└─── Standing order payment

Fields§

§bank_operation_code: String

Bank operation code (exactly 4 alphabetic characters)

Specifies the type of operation being performed in the SWIFT MT message. This code determines processing rules, routing behavior, and regulatory requirements for the transaction.

Format: Exactly 4 uppercase alphabetic characters Character set: A-Z only Case handling: Automatically converted to uppercase

§Standard Codes

  • "CRED" - Credit Transfer (standard processing)
  • "CRTS" - Credit Transfer Same Day (expedited)
  • "SPAY" - Supplementary Payment (additional details)
  • "SSTD" - Standing Order (recurring payment)

§Extended Codes

  • "SPRI" - Special Priority (high priority)
  • "URGP" - Urgent Payment (expedited processing)
  • "RTGS" - Real Time Gross Settlement
  • "NETS" - Net Settlement processing

Implementations§

Source§

impl Field23B

Source

pub fn new(bank_operation_code: String) -> Self

Create a new Field23B with comprehensive validation

Creates a new bank operation code field with the provided code string. The code is automatically normalized to uppercase and validated for format compliance and business rules.

§Arguments
  • bank_operation_code - The 4-character operation code
§Examples
use swift_mt_message::fields::Field23B;

// Standard credit transfer
let field = Field23B::new("CRED".to_string());

// Same day credit transfer
let field = Field23B::new("CRTS".to_string());

// Case insensitive (automatically converted to uppercase)
let field = Field23B::new("cred".to_string());
assert_eq!(field.operation_code(), "CRED");
§Validation

The constructor performs format validation and case normalization. Full business rule validation occurs during SWIFT message processing.

Source

pub fn operation_code(&self) -> &str

Get the bank operation code

Returns the 4-character bank operation code that specifies the type of operation being performed.

§Returns

A string slice containing the operation code in uppercase

§Example
let field = Field23B::new("CRED".to_string());
assert_eq!(field.operation_code(), "CRED");
Source

pub fn is_standard_code(&self) -> bool

Check if this is a standard operation code

Determines if the operation code is one of the widely recognized standard codes used in SWIFT MT messages.

§Returns

true if the code is a standard operation code

§Example
let standard = Field23B::new("CRED".to_string());
assert!(standard.is_standard_code());

let custom = Field23B::new("CUST".to_string());
assert!(!custom.is_standard_code());
Source

pub fn is_extended_code(&self) -> bool

Check if this is an extended operation code

Determines if the operation code is one of the extended codes that may be used by specific institutions or regions.

§Returns

true if the code is an extended operation code

§Example
let extended = Field23B::new("SPRI".to_string());
assert!(extended.is_extended_code());

let standard = Field23B::new("CRED".to_string());
assert!(!standard.is_extended_code());
Source

pub fn requires_same_day_processing(&self) -> bool

Check if this operation code requires same-day processing

Determines if the operation code mandates same-day settlement or expedited processing.

§Returns

true if same-day processing is required

§Example
let same_day = Field23B::new("CRTS".to_string());
assert!(same_day.requires_same_day_processing());

let standard = Field23B::new("CRED".to_string());
assert!(!standard.requires_same_day_processing());
Source

pub fn allows_field_23e(&self) -> bool

Check if this operation code allows Field 23E

Determines if instruction codes (Field 23E) are permitted when using this operation code, based on SWIFT business rules.

§Returns

true if Field 23E is allowed with this operation code

§Example
let allows_23e = Field23B::new("CRED".to_string());
assert!(allows_23e.allows_field_23e());

let no_23e = Field23B::new("SSTD".to_string());
assert!(!no_23e.allows_field_23e());
Source

pub fn processing_priority(&self) -> u8

Get the processing priority level

Returns the processing priority associated with this operation code. Higher numbers indicate higher priority.

§Returns

Priority level (1=low, 2=normal, 3=high, 4=urgent)

§Example
let urgent = Field23B::new("URGP".to_string());
assert_eq!(urgent.processing_priority(), 4);

let standard = Field23B::new("CRED".to_string());
assert_eq!(standard.processing_priority(), 2);
Source

pub fn description(&self) -> &'static str

Get a human-readable description of the operation code

Returns a descriptive string explaining what this operation code represents and its typical usage.

§Returns

A descriptive string

§Example
let field = Field23B::new("CRED".to_string());
println!("{}", field.description());
Source

pub fn settlement_timing(&self) -> &'static str

Get the settlement timing for this operation code

Returns the expected settlement timing based on the operation code.

§Returns

Settlement timing description

§Example
let field = Field23B::new("CRTS".to_string());
assert_eq!(field.settlement_timing(), "Same Day");
Source

pub fn is_well_formed(&self) -> bool

Check if the operation code is well-formed

Performs additional validation beyond basic format checking, ensuring the code follows institutional standards.

§Returns

true if the operation code is well-formed

§Example
let good_code = Field23B::new("CRED".to_string());
assert!(good_code.is_well_formed());

let poor_code = Field23B::new("XXXX".to_string());
assert!(!poor_code.is_well_formed());

Trait Implementations§

Source§

impl Clone for Field23B

Source§

fn clone(&self) -> Field23B

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Field23B

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Field23B

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Field23B

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Field23B

Source§

fn eq(&self, other: &Field23B) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Field23B

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl SwiftField for Field23B

Source§

fn parse(value: &str) -> Result<Self>

Parse field value from string representation
Source§

fn to_swift_string(&self) -> String

Convert field back to SWIFT string format
Source§

fn validate(&self) -> ValidationResult

Validate field according to SWIFT format rules
Source§

fn format_spec() -> &'static str

Get field format specification
Source§

impl StructuralPartialEq for Field23B

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,