pub trait MTMessageType {
// Required methods
fn from_blocks(blocks: Vec<MessageBlock>) -> Result<Self>
where Self: Sized;
fn get_field(&self, tag: &str) -> Option<&Field>;
fn get_fields(&self, tag: &str) -> Vec<&Field>;
fn get_all_fields(&self) -> Vec<&Field>;
fn text_fields(&self) -> &[Field];
}
Expand description
Common trait for all MT message types
Required Methods§
Sourcefn from_blocks(blocks: Vec<MessageBlock>) -> Result<Self>where
Self: Sized,
fn from_blocks(blocks: Vec<MessageBlock>) -> Result<Self>where
Self: Sized,
Create message from parsed blocks
Sourcefn get_fields(&self, tag: &str) -> Vec<&Field>
fn get_fields(&self, tag: &str) -> Vec<&Field>
Get all fields with a specific tag
Sourcefn get_all_fields(&self) -> Vec<&Field>
fn get_all_fields(&self) -> Vec<&Field>
Get all fields
Sourcefn text_fields(&self) -> &[Field]
fn text_fields(&self) -> &[Field]
Get the text block fields