pub trait SwiftMessageBody:
Debug
+ Clone
+ Send
+ Sync
+ Serialize
+ Any {
// Required methods
fn message_type() -> &'static str;
fn from_fields(
fields: HashMap<String, Vec<(String, usize)>>,
) -> 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 from_fields_with_config(
fields: HashMap<String, Vec<(String, usize)>>,
config: &ParserConfig,
) -> Result<ParseResult<Self>, ParseError>
where Self: Sized { ... }
fn to_ordered_fields(&self) -> Vec<(String, String)> { ... }
}
Expand description
Core trait for Swift message types
Required Methods§
Sourcefn message_type() -> &'static str
fn message_type() -> &'static str
Get the message type identifier (e.g., “103”, “202”)
Sourcefn from_fields(
fields: HashMap<String, Vec<(String, usize)>>,
) -> SwiftResult<Self>where
Self: Sized,
fn from_fields(
fields: HashMap<String, Vec<(String, usize)>>,
) -> SwiftResult<Self>where
Self: Sized,
Create from field map with sequential consumption tracking
Sourcefn required_fields() -> Vec<&'static str>
fn required_fields() -> Vec<&'static str>
Get required field tags for this message type
Sourcefn optional_fields() -> Vec<&'static str>
fn optional_fields() -> Vec<&'static str>
Get optional field tags for this message type
Provided Methods§
Sourcefn from_fields_with_config(
fields: HashMap<String, Vec<(String, usize)>>,
config: &ParserConfig,
) -> Result<ParseResult<Self>, ParseError>where
Self: Sized,
fn from_fields_with_config(
fields: HashMap<String, Vec<(String, usize)>>,
config: &ParserConfig,
) -> Result<ParseResult<Self>, ParseError>where
Self: Sized,
Create from field map with configuration for error collection
Sourcefn to_ordered_fields(&self) -> Vec<(String, String)>
fn to_ordered_fields(&self) -> Vec<(String, String)>
Convert to ordered field list for MT serialization Returns fields in the correct sequence order for multi-sequence messages
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.