pub struct Encoder { /* private fields */ }Expand description
FIX message encoder.
The encoder builds FIX messages by appending fields in tag=value format. It handles BeginString, BodyLength, and Checksum fields automatically.
Implementations§
Source§impl Encoder
impl Encoder
Sourcepub fn new(begin_string: &'static str) -> Encoder
pub fn new(begin_string: &'static str) -> Encoder
Creates a new encoder with the specified BeginString.
§Arguments
begin_string- The FIX version string (e.g., “FIX.4.4”)
Sourcepub fn with_capacity(begin_string: &'static str, capacity: usize) -> Encoder
pub fn with_capacity(begin_string: &'static str, capacity: usize) -> Encoder
Creates a new encoder with pre-allocated capacity.
§Arguments
begin_string- The FIX version stringcapacity- Initial buffer capacity in bytes
Sourcepub fn put_int(&mut self, tag: u32, value: i64)
pub fn put_int(&mut self, tag: u32, value: i64)
Appends a field with an integer value.
§Arguments
tag- The field tag numbervalue- The field value
Sourcepub fn put_uint(&mut self, tag: u32, value: u64)
pub fn put_uint(&mut self, tag: u32, value: u64)
Appends a field with an unsigned integer value.
§Arguments
tag- The field tag numbervalue- The field value
Sourcepub fn put_bool(&mut self, tag: u32, value: bool)
pub fn put_bool(&mut self, tag: u32, value: bool)
Appends a field with a boolean value (Y/N).
§Arguments
tag- The field tag numbervalue- The field value
Sourcepub fn put_char(&mut self, tag: u32, value: char)
pub fn put_char(&mut self, tag: u32, value: char)
Appends a field with a single character value.
§Arguments
tag- The field tag numbervalue- The field value
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Encoder
impl RefUnwindSafe for Encoder
impl Send for Encoder
impl Sync for Encoder
impl Unpin for Encoder
impl UnwindSafe for Encoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more