Crates.io | yule_log_macros |
lib.rs | yule_log_macros |
version | 0.3.2 |
created_at | 2025-09-23 14:11:10.811159+00 |
updated_at | 2025-09-25 11:48:44.588025+00 |
description | Derive macros for the yule_log ULOG parser crate. |
homepage | |
repository | https://github.com/annoybot/yule_log |
max_upload_size | |
id | 1851570 |
size | 35,912 |
Derive macros for the yule_log ULOG parser.
#[derive(ULogData)]: Maps ULOG subscriptions directly into your structs.
#[derive(ULogMessages)]: Aggregates your structs into a single streaming interface.
Forward unknown messages: Capture raw ULOG messages via #[yule_log(forward_other)].
Memory Efficient: Preserves the streaming nature of the yule_log parser.
For more information, see: yule_log.
yule_log = { version = "0.3", features = ["macros"] }
#[derive(ULogData)]
pub struct VehicleLocalPosition {
pub timestamp: u64,
pub x: f32,
pub y: f32,
pub z: f32,
}
#[derive(ULogMessages)]
pub enum LoggedMessages {
VehicleLocalPosition(VehicleLocalPosition),
#[yule_log(forward_other)]
Other(yule_log::model::msg::UlogMessage),
}
let stream = LoggedMessages::stream(reader)?;
for msg_res in stream {
let msg = msg_res?;
match msg {
LoggedMessages::VehicleLocalPosition(v) => println!("x={} y={} z={}", v.x, v.y, v.z),
LoggedMessages::Other(msg) => println!("Other message: {:?}", msg),
}
}
This project is licensed under the MIT Licence.