pub trait MessageFactory {
// Required methods
fn start_template(&mut self, id: u32, name: &str);
fn stop_template(&mut self);
fn set_value(&mut self, id: u32, name: &str, value: Option<Value>);
fn start_sequence(&mut self, id: u32, name: &str, length: u32);
fn start_sequence_item(&mut self, index: u32);
fn stop_sequence_item(&mut self);
fn stop_sequence(&mut self);
fn start_group(&mut self, name: &str);
fn stop_group(&mut self);
fn start_template_ref(&mut self, name: &str, dynamic: bool);
fn stop_template_ref(&mut self);
}Expand description
Defines the interface for message factories.
The callback functions are called when the specific event occurs during message processing.
Required Methods§
Sourcefn start_template(&mut self, id: u32, name: &str)
fn start_template(&mut self, id: u32, name: &str)
Called when a <template> processing is started.
idis the template id;nameis the template name.
Sourcefn stop_template(&mut self)
fn stop_template(&mut self)
Called when a <template> processing is finished.
Sourcefn set_value(&mut self, id: u32, name: &str, value: Option<Value>)
fn set_value(&mut self, id: u32, name: &str, value: Option<Value>)
Called when a field element is processed.
idis the field instruction id;nameis the field name;valueis the field value which is optional.
Sourcefn start_sequence(&mut self, id: u32, name: &str, length: u32)
fn start_sequence(&mut self, id: u32, name: &str, length: u32)
Called when a <sequence> element processing is started.
idis the sequence instruction id; can be0if id is not specified;nameis the sequence name;lengthis the sequence length.
Sourcefn start_sequence_item(&mut self, index: u32)
fn start_sequence_item(&mut self, index: u32)
Called when a sequence item processing is started.
indexis the sequence item index.
Sourcefn stop_sequence_item(&mut self)
fn stop_sequence_item(&mut self)
Called when a sequence item processing is finished.
Sourcefn stop_sequence(&mut self)
fn stop_sequence(&mut self)
Called when a <sequence> processing is finished.
Sourcefn start_group(&mut self, name: &str)
fn start_group(&mut self, name: &str)
Called when a <group> element processing is started.
nameis the group name.
Sourcefn stop_group(&mut self)
fn stop_group(&mut self)
Called when a <group> element processing is finished.
Sourcefn start_template_ref(&mut self, name: &str, dynamic: bool)
fn start_template_ref(&mut self, name: &str, dynamic: bool)
Called when a template reference (<templateRef>) processing is started.
nameis the template name;dynamicistrueif the template reference is dynamic.
Sourcefn stop_template_ref(&mut self)
fn stop_template_ref(&mut self)
Called when a template reference (<templateRef>) processing is finished.