pub struct SwiftMessage<T: SwiftMessageBody> {
pub basic_header: BasicHeader,
pub application_header: ApplicationHeader,
pub user_header: Option<UserHeader>,
pub trailer: Option<Trailer>,
pub message_type: String,
pub fields: T,
}
Expand description
Complete SWIFT message with headers and body
Fields§
§basic_header: BasicHeader
Basic Header (Block 1)
application_header: ApplicationHeader
Application Header (Block 2)
user_header: Option<UserHeader>
User Header (Block 3) - Optional
trailer: Option<Trailer>
Trailer (Block 5) - Optional
message_type: String
Message type identifier
fields: T
Parsed message body with typed fields
Implementations§
Source§impl<T: SwiftMessageBody> SwiftMessage<T>
impl<T: SwiftMessageBody> SwiftMessage<T>
Sourcepub fn has_reject_codes(&self) -> bool
pub fn has_reject_codes(&self) -> bool
Check if this message contains reject codes (MT103 specific)
Reject messages are identified by checking:
- Field 20 (Sender’s Reference) for “REJT” prefix
- Block 3 field 108 (MUR - Message User Reference) for “REJT”
- Field 72 (Sender to Receiver Information) containing
/REJT/
code
Sourcepub fn has_return_codes(&self) -> bool
pub fn has_return_codes(&self) -> bool
Check if this message contains return codes (MT103 specific)
Return messages are identified by checking:
- Field 20 (Sender’s Reference) for “RETN” prefix
- Block 3 field 108 (MUR - Message User Reference) for “RETN”
- Field 72 (Sender to Receiver Information) containing
/RETN/
code
pub fn is_cover_message(&self) -> bool
pub fn is_stp_message(&self) -> bool
Sourcepub fn validate(&self) -> ValidationResult
pub fn validate(&self) -> ValidationResult
Validate message against business rules using JSONLogic This validation method has access to both headers and message fields, allowing for comprehensive validation of MT103 and other message types.
pub fn to_mt_message(&self) -> String
Trait Implementations§
Source§impl<T: Clone + SwiftMessageBody> Clone for SwiftMessage<T>
impl<T: Clone + SwiftMessageBody> Clone for SwiftMessage<T>
Source§fn clone(&self) -> SwiftMessage<T>
fn clone(&self) -> SwiftMessage<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug + SwiftMessageBody> Debug for SwiftMessage<T>
impl<T: Debug + SwiftMessageBody> Debug for SwiftMessage<T>
Source§impl<'de, T> Deserialize<'de> for SwiftMessage<T>where
T: Deserialize<'de> + SwiftMessageBody,
impl<'de, T> Deserialize<'de> for SwiftMessage<T>where
T: Deserialize<'de> + SwiftMessageBody,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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<T> Serialize for SwiftMessage<T>where
T: Serialize + SwiftMessageBody,
impl<T> Serialize for SwiftMessage<T>where
T: Serialize + SwiftMessageBody,
Auto Trait Implementations§
impl<T> Freeze for SwiftMessage<T>where
T: Freeze,
impl<T> RefUnwindSafe for SwiftMessage<T>where
T: RefUnwindSafe,
impl<T> Send for SwiftMessage<T>
impl<T> Sync for SwiftMessage<T>
impl<T> Unpin for SwiftMessage<T>where
T: Unpin,
impl<T> UnwindSafe for SwiftMessage<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more