pub struct Encoder { /* private fields */ }
Expand description
A buffered, content-agnostic FIX encoder.
Encoder
is the fundamental building block for building higher-level
FIX encoders. It allows for encoding of arbitrary payloads and takes care of
BodyLength (9)
and CheckSum (10)
.
§Examples
use hotfix_encoding::{Config, Encoder, GetConfig};
let mut buffer = Vec::new();
let mut encoder = Encoder::default();
encoder.config_mut().separator = b'|';
let msg = encoder.start_message(b"FIX.4.4", &mut buffer, b"A");
let data = msg.done();
Implementations§
Source§impl Encoder
impl Encoder
Sourcepub fn start_message<'a, B>(
&'a mut self,
begin_string: &[u8],
buffer: &'a mut B,
msg_type: &[u8],
) -> EncoderHandle<'a, B>where
B: Buffer,
pub fn start_message<'a, B>(
&'a mut self,
begin_string: &[u8],
buffer: &'a mut B,
msg_type: &[u8],
) -> EncoderHandle<'a, B>where
B: Buffer,
Creates a new EncoderHandle
that allows to set the field values of a
new FIX message. The raw byte contents of the newly created FIX messages
are appended directly at the end of buffer
.
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