Trait SwiftMessageBody

Source
pub trait SwiftMessageBody:
    Debug
    + Clone
    + Send
    + Sync
    + Serialize
    + Any {
    // Required methods
    fn message_type() -> &'static str;
    fn from_fields(fields: HashMap<String, Vec<String>>) -> SwiftResult<Self>
       where Self: Sized;
    fn to_fields(&self) -> HashMap<String, Vec<String>>;
    fn required_fields() -> Vec<&'static str>;
    fn optional_fields() -> Vec<&'static str>;

    // Provided methods
    fn is_cover_message(&self) -> bool { ... }
    fn has_reject_codes(&self) -> bool { ... }
    fn has_return_codes(&self) -> bool { ... }
    fn is_stp_message(&self) -> bool { ... }
}
Expand description

Core trait for Swift message types

Required Methods§

Source

fn message_type() -> &'static str

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

Source

fn from_fields(fields: HashMap<String, Vec<String>>) -> SwiftResult<Self>
where Self: Sized,

Create from field map

Source

fn to_fields(&self) -> HashMap<String, Vec<String>>

Convert to field map

Source

fn required_fields() -> Vec<&'static str>

Get required field tags for this message type

Source

fn optional_fields() -> Vec<&'static str>

Get optional field tags for this message type

Provided Methods§

Source

fn is_cover_message(&self) -> bool

Check if this message is a cover message (default: false)

Source

fn has_reject_codes(&self) -> bool

Source

fn has_return_codes(&self) -> bool

Source

fn is_stp_message(&self) -> bool

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§