Struct MT940

Source
pub struct MT940 { /* private fields */ }
Expand description

MT940: Customer Statement Message

Implementations§

Source§

impl MT940

Source

pub fn transaction_reference(&self) -> Result<String>

Get transaction reference number (Field 20)

Source

pub fn account_identification(&self) -> Result<String>

Get account identification (Field 25)

Source

pub fn statement_number(&self) -> Result<String>

Get statement number/sequence number (Field 28C)

Source

pub fn opening_balance(&self) -> Result<String>

Get opening balance (Field 60F or 60M)

Source

pub fn parse_opening_balance(&self) -> Result<(String, NaiveDate, String, f64)>

Parse opening balance into components

Source

pub fn closing_balance(&self) -> Result<String>

Get closing balance (Field 62F or 62M)

Source

pub fn parse_closing_balance(&self) -> Result<(String, NaiveDate, String, f64)>

Parse closing balance into components

Source

pub fn closing_available_balance(&self) -> Option<String>

Get closing available balance (Field 64)

Source

pub fn parse_closing_available_balance( &self, ) -> Option<Result<(String, NaiveDate, String, f64)>>

Parse closing available balance into components

Source

pub fn statement_lines(&self) -> Vec<String>

Get all statement lines (Field 61)

Source

pub fn information_to_account_owner(&self) -> Vec<String>

Get all information to account owner (Field 86)

Source

pub fn forward_available_balance(&self) -> Option<String>

Get forward available balance (Field 65) - optional

Source

pub fn parse_statement_line(&self, line: &str) -> Result<StatementLineInfo>

Parse a statement line (Field 61) into components This is a complex field with value date, entry date, debit/credit, amount, transaction type, etc.

Source

pub fn parsed_statement_lines(&self) -> Vec<Result<StatementLineInfo>>

Get statement lines with parsed information

Trait Implementations§

Source§

impl Clone for MT940

Source§

fn clone(&self) -> MT940

Returns a copy 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 MT940

Source§

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

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

impl<'de> Deserialize<'de> for MT940

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 MTMessageType for MT940

Source§

fn from_blocks(blocks: Vec<MessageBlock>) -> Result<Self>

Create message from parsed blocks
Source§

fn get_field(&self, tag: &str) -> Option<&Field>

Get a field by tag
Source§

fn get_fields(&self, tag: &str) -> Vec<&Field>

Get all fields with a specific tag
Source§

fn get_all_fields(&self) -> Vec<&Field>

Get all fields
Source§

fn text_fields(&self) -> &[Field]

Get the text block fields
Source§

impl Serialize for MT940

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

Auto Trait Implementations§

§

impl Freeze for MT940

§

impl RefUnwindSafe for MT940

§

impl Send for MT940

§

impl Sync for MT940

§

impl Unpin for MT940

§

impl UnwindSafe for MT940

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, 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>,