| Crates.io | litch |
| lib.rs | litch |
| version | 0.0.1 |
| created_at | 2025-10-25 02:58:52.816556+00 |
| updated_at | 2025-10-25 04:07:01.118495+00 |
| description | Simple parser for ITCH 5.0, oriented toward live messages. |
| homepage | |
| repository | https://github.com/j-stach/litch |
| max_upload_size | |
| id | 1899607 |
| size | 52,287 |
Parser for ITCH 5.0, inspired by itchy
but oriented toward live message handling.
This crate should be presumed experimental and non-functional until integration testing has been completed. If you are willing and able to assist with integration testing, please leave a response under this issue.
litch to your Rust project (v2024 or more recent):cargo add litch
ItchMessage enum.use std::net::UdpSocket;
use litch::ItchMessage;
let socket = UdpSocket::bind(127.0.0.1:0).unwrap();
let mut buf = [0u8; 1024];
// TODO: Connect to TotalView-ITCH feed
let (len, _origin) = socket.recv_from(&mut buf).unwrap();
let msg = ItchMessage::parse(buf[..len]).unwrap();
match to extract message contents.
All messages have metadata and a body which contains variant-specific data.use litch::msg::SystemEvent::*;
use ItchMessage::*;
match msg {
SystemEvent { metadata, body } => {
match body {
BeginMessages => {/* Do something */},
_ => {/* Do something else */}
}
},
_ => {/* Do nothing */}
}
ItchMetadata) can be accessed without matching.let meta = msg.metadata();
let _time: NaiveTime = meta.timestamp;
let _locate: u16 = meta.stock_locate;
let _num: u16 = meta.tracking_number;
Development history and current tasks are tracked in TODO.md.
Developer resources:
Contributions are welcome! Submit issues and pull requests to this repository.