Module encode

Module encode 

Source
Expand description

Message building and encoding.

FIX messages can be easily built using the MessageBuilder. The MessageBuilder can be given any number of tag/value pairs. It is recommended to use Tags for tags, and the following for values:

§Example

use forgefix::fix::encode::{MessageBuilder, SerializedInt};
use forgefix::fix::generated::{self, MsgType, Tags};

let builder = MessageBuilder::new("FIX.4.2", MsgType::ORDER_SINGLE.into())
    .push(Tags::Account, b"my-account-num")
    .push(Tags::OrderQty, SerializedInt::from(1u32).as_bytes())
    .push(Tags::OrdType, generated::OrdType::LIMIT.into())
    .push(Tags::Price, b"10.42")
    .push(Tags::Symbol, b"TICKER SYMBOL");

Structs§

MessageBuilder
A struct for building FIX messages.
SerializedInt
A u64/u32 wrapper that can convert an int to its ASCII representation

Constants§

TIME_FORMAT
The time format string represented in chrono format syntax

Functions§

formatted_time
Returns the current time in TIME_FORMAT