Trait MTMessageType

Source
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§

Source

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

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

Implementors§