yule_log
A streaming ULOG parser written in Rust.
Features
- Memory Efficient: A stream-oriented design allows
yule_loghandle arbitrarily large files in real time without fully loading them into memory. - Derive API: Map LoggedData messages directly into your structs using the optional
macrosfeature. - Complete coverage: Supports all ULog message types.
- Binary fidelity: Can parse and re-emit a ULog file byte-for-byte identical to the original.
- Safe and robust: Full Rust type safety with comprehensive error handling.
🌟Derive API
The macros feature provides a serde-like experience, allowing ULOG data to be mapped directly into your own structs.
With this feature, there is no need to manually track subscription names, msg_ids, or field indices, the macros handle all of that for you automatically. The stream-oriented nature of the underlying parser is fully preserved.
User guide
1. Enable the feature in Cargo.toml
= { ="0.3.0", = ["macros"] }
2. Map subscriptions to structs
Define one struct for each ULOG subscription you want to map,
and annotate it with: #[derive(ULogData)].
Example:
In most cases, no extra config is needed—just name your struct and fields to match the names used in the ULOG. Only include the fields you need.
The macros will infer the ULOG names by converting your struct and field names to snake case.
⚠️You can override the default mapping
if needed: #[yule_log(subscription_name = "...", multi_id = N)]. By default, struct fields will be validated
against the ULOG file, and any missing fields will cause an error. This can be overriden by making a field an
Option<T>, as shown above for extra_field.
3. List all subscriptions in an enum
Declare an enum where each variant wraps one of your ULogData structs, and annotate it with:
#[derive(ULogMessages)].
This enum will then become your interface to the data.
⚠️ Raw ULOG messages can be captured by annotating an enum variant as follows:
Other,
4. Iterate through mapped messages
The derive macro will generate a ::stream() method on your enum, allowing the
messages to be easily retrieved.
Full example:
use File;
use BufReader;
use UlogMessage;
use ;
Low Level API
For those requiring complete control over the parsing process, the original low level API is still available.
Example:
let reader = new;
let parser = new
.include_header
.include_timestamp
.include_padding
.build?;
for result in parser
This example is also available in the examples directory as simple.rs.
License
This project is licensed under the MIT Licence.