Expand description
§refix-message
Framing, tokenising and raw FIX messages for ReFIX. A RawMessage indexes a frame’s
fields and reads them on demand, without copying.
ReFIX is in early development, and APIs change between 0.x releases.
use refix_message::stream::Outcome;
use refix_message::{MessageStream, Tag, Tokenizer};
fn main() {
let log = b"2026-10-10 09:30:00 IN 8=FIX.4.4\x019=5\x0135=0\x0110=163\x01\n";
let mut stream = MessageStream::new(Tokenizer::default());
stream.feed(log);
loop {
match stream.next_message() {
Outcome::Message(message) => println!("{:?}", message.get_str(Tag(35))),
Outcome::Garbled { bytes, .. } => println!("skipped {} bytes", bytes.len()),
Outcome::Incomplete => break,
}
}
}Tokenizer::tokenize reads a single frame. Typed messages are generated on top of it: refix-fix44 for FIX 4.4, or
refix-cli for your own dictionary.
§Features
bigdecimal-04convertsDecimalto and from bigdecimal 0.4.chrono-04convertsDate,TimeandUtcTimestampto and from chrono 0.4.jiff-02convertsDate,TimeandUtcTimestampto and from jiff 0.2.rust_decimal-1convertsDecimalto and from rust_decimal 1.time-03convertsDate,TimeandUtcTimestampto and from time 0.3.
§License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Re-exports§
pub use group::Group;pub use group::GroupLayout;pub use group::GroupTable;pub use group::GroupTableError;pub use group::Instances;pub use group::KnownTags;pub use group::OwnedGroupTable;pub use multiple_values::MultipleValues;pub use stream::MessageStream;
Modules§
- framing
- Framing: delimiting one checksum-verified FIX message from a byte stream.
- group
- multiple_
values - stream
Structs§
- Date
- A FIX date, as in a UTCDateOnly or LocalMktDate field.
- Decimal
- A FIX float, such as a price or quantity, as
mantissa * 10^exponent. - Invalid
Value - A field value whose bytes can’t be read as the field’s declared data type.
- Month
Year - A FIX MonthYear, such as a contract’s maturity, with an optional day or week of the month.
- OutOf
Range - A value outside the range of the type it converts to.
- RawMessage
- Raw bytes of a FIX message and an index of every field in wire order.
- Scope
- A bounded view of a message’s fields - the whole frame or one group instance.
- Slot
- A field’s position in a message’s index.
- Tag
- A FIX tag number, e.g.
Tag(35)for MsgType. - Time
- A FIX time of day, as in a UTCTimeOnly or LocalMktTime field, keeping its precision.
- Time
Precision - How finely a time is written, as its count of fraction digits.
- Tokenizer
- Splits a framed FIX message into its fields.
- UtcTimestamp
- A FIX UTCTimestamp as nanoseconds since the Unix epoch, keeping its precision.
Enums§
- Tokenize
Error - Issues that can arise when the bytes handed to the tokeniser are not a valid FIX message.