Trait fefix::prelude::Configure [−][src]
pub trait Configure: Clone + Default {
fn separator(&self) -> u8 { ... }
fn max_message_size(&self) -> Option<usize> { ... }
fn verify_checksum(&self) -> bool { ... }
fn should_decode_associative(&self) -> bool { ... }
}
Expand description
A provider of configuration options related to FIX encoding and decoding.
Implementing this trait
Before implementing this trait, you should look into Config
, which is
adequate for most uses. The only benefit of writing your own Configure
implementor rather than using Config
is the possibility of relying on
constants in code rather than accessing struct
members, which results in
better inlining by LLVM. E.g.
use fefix::tagvalue::Configure;
#[derive(Default, Copy, Clone)]
struct FixInlineConfig {}
impl Configure for FixInlineConfig {
#[inline]
fn max_message_size(&self) -> Option<usize> {
None
}
#[inline]
fn verify_checksum(&self) -> bool {
true
}
}
Needless to say, think twice before polluting your codebase with such micro-optimizations.
Provided methods
The delimiter character, which terminates every tag-value pair including the last one.
ASCII 0x1 (SOH) is the default separator character.
This setting is relevant for both encoding and decoding operations.
fn max_message_size(&self) -> Option<usize>
fn max_message_size(&self) -> Option<usize>
The maximum allowed size for any single FIX message. No restrictions are
imposed when it is None
.
fn verify_checksum(&self) -> bool
fn verify_checksum(&self) -> bool
Determines wheather or not CheckSum(10)
should be verified.
This setting has no effect when encoding FIX messages.
fn should_decode_associative(&self) -> bool
fn should_decode_associative(&self) -> bool
Determines whether or not the decoder needs to have access to associative FIX fields. If turned off, only linear access is possible.