[−][src]Trait iso8583_rs::iso8583::field::Field
This trait represents a ISO field (specific implementations are FixedField, VarField and BmpField)
Required methods
fn name(&self) -> &String
Returns the name of the field
fn parse(
&self,
in_buf: &mut dyn BufRead,
f2d_map: &mut HashMap<String, Vec<u8>>
) -> Result<(), ParseError>
&self,
in_buf: &mut dyn BufRead,
f2d_map: &mut HashMap<String, Vec<u8>>
) -> Result<(), ParseError>
Parses the field by reading from in_buf and stores the result into f2d_map Returns a ParseError on failure
fn assemble(
&self,
out_buf: &mut Vec<u8>,
iso_msg: &IsoMsg
) -> Result<u32, ParseError>
&self,
out_buf: &mut Vec<u8>,
iso_msg: &IsoMsg
) -> Result<u32, ParseError>
Assembles the field i.e. appends it data into out_buf Returns the number of bytes written on success or a ParseError on failure
fn position(&self) -> u32
Returns the position of the field in the parent field (mostly applicable for chlidren of BmpField)
fn children(&self) -> Vec<&dyn Field>
Returns children as Vec
fn child_by_pos(&self, pos: u32) -> &dyn Field
Returns the child field by position
fn child_by_name(&self, name: &String) -> &dyn Field
Returns child field by name
fn to_string(&self, data: &Vec<u8>) -> String
Returns a string that represents the field value in ascii
fn to_raw(&self, val: &str) -> Vec<u8>
Returns field value as binary (wire format)
Implementors
impl Field for BmpField
[src]
fn name(&self) -> &String
[src]
fn parse(
&self,
in_buf: &mut dyn BufRead,
f2d_map: &mut HashMap<String, Vec<u8>>
) -> Result<(), ParseError>
[src]
&self,
in_buf: &mut dyn BufRead,
f2d_map: &mut HashMap<String, Vec<u8>>
) -> Result<(), ParseError>
fn assemble(
&self,
out_buf: &mut Vec<u8>,
iso_msg: &IsoMsg
) -> Result<u32, ParseError>
[src]
&self,
out_buf: &mut Vec<u8>,
iso_msg: &IsoMsg
) -> Result<u32, ParseError>
fn position(&self) -> u32
[src]
fn children(&self) -> Vec<&dyn Field>
[src]
fn child_by_pos(&self, pos: u32) -> &dyn Field
[src]
fn child_by_name(&self, name: &String) -> &dyn Field
[src]
fn to_string(&self, data: &Vec<u8>) -> String
[src]
fn to_raw(&self, _val: &str) -> Vec<u8>
[src]
impl Field for FixedField
[src]
fn name(&self) -> &String
[src]
fn parse(
&self,
in_buf: &mut dyn BufRead,
f2d_map: &mut HashMap<String, Vec<u8>>
) -> Result<(), ParseError>
[src]
&self,
in_buf: &mut dyn BufRead,
f2d_map: &mut HashMap<String, Vec<u8>>
) -> Result<(), ParseError>
fn assemble(
&self,
out_buf: &mut Vec<u8>,
iso_msg: &IsoMsg
) -> Result<u32, ParseError>
[src]
&self,
out_buf: &mut Vec<u8>,
iso_msg: &IsoMsg
) -> Result<u32, ParseError>
fn position(&self) -> u32
[src]
fn children(&self) -> Vec<&dyn Field>
[src]
fn child_by_pos(&self, _pos: u32) -> &dyn Field
[src]
fn child_by_name(&self, _name: &String) -> &dyn Field
[src]
fn to_string(&self, data: &Vec<u8>) -> String
[src]
fn to_raw(&self, val: &str) -> Vec<u8>
[src]
impl Field for VarField
[src]
fn name(&self) -> &String
[src]
fn parse(
&self,
in_buf: &mut dyn BufRead,
f2d_map: &mut HashMap<String, Vec<u8>>
) -> Result<(), ParseError>
[src]
&self,
in_buf: &mut dyn BufRead,
f2d_map: &mut HashMap<String, Vec<u8>>
) -> Result<(), ParseError>
fn assemble(
&self,
out_buf: &mut Vec<u8>,
iso_msg: &IsoMsg
) -> Result<u32, ParseError>
[src]
&self,
out_buf: &mut Vec<u8>,
iso_msg: &IsoMsg
) -> Result<u32, ParseError>