SwiftMessageBody

Trait SwiftMessageBody 

Source
pub trait SwiftMessageBody:
    Debug
    + Clone
    + Send
    + Sync
    + Serialize
    + Any {
    // Required methods
    fn message_type() -> &'static str;
    fn to_mt_string(&self) -> String;

    // Provided methods
    fn parse_from_block4(_block4: &str) -> Result<Self>
       where Self: Sized { ... }
    fn validate_network_rules(
        &self,
        _stop_on_first_error: bool,
    ) -> Vec<SwiftValidationError> { ... }
}
Expand description

Trait for SWIFT message types (MT103, MT202, etc.)

Provides parsing, serialization, and validation for complete messages.

Required Methods§

Source

fn message_type() -> &'static str

Get the message type identifier (e.g., “103”, “202”, “940”)

Source

fn to_mt_string(&self) -> String

Convert to SWIFT MT format (Block 4 content, no wrapper braces)

Provided Methods§

Source

fn parse_from_block4(_block4: &str) -> Result<Self>
where Self: Sized,

Parse message from Block 4 content (fields only)

Source

fn validate_network_rules( &self, _stop_on_first_error: bool, ) -> Vec<SwiftValidationError>

Validate SWIFT network rules (C/D/E series) for this message

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§