Skip to main content

mdflib/
lib.rs

1//! # mdflib
2//!
3//! Safe Rust bindings for the `mdflib` C++ library. `mdflib` is a library for reading and writing MDF (Measurement Data Format) files.
4//! This crate provides a high-level API that wraps the C++ library in safe Rust code.
5//!
6//! ## Features
7//!
8//! *   Read and write MDF files (versions 3.x and 4.x).
9//! *   Access to file metadata and channel information.
10//! *   Read and write channel data.
11//! *   `bundled` (default): Compiles and statically links the `mdflib` C++ library.
12//! *   `system`: Links against a system-installed version of `mdflib`.
13//!
14//! See [`crate::MdfReader`] and [`crate::MdfWriter`] docs for examples of how
15//! to use the library. The 'examples/read_mdf.rs' and workspace binary
16//! 'mf4_candump' provide additional usage examples.
17
18pub mod canmessage;
19pub mod channel;
20pub mod channelgroup;
21pub mod datagroup;
22pub mod error;
23pub mod file;
24pub mod header;
25pub mod reader;
26pub mod writer;
27
28pub mod log;
29
30// Re-export binding enums
31pub use mdflib_sys::{
32    ArrayStorage, ArrayType, BusType, CanErrorType, ChannelType, ConversionType, ETagDataType,
33    EventCause, EventType, MdfBusType, MessageType, RangeType, SourceType, SyncType,
34};
35
36// New MDF object modules
37pub mod attachment;
38pub mod canbusobserver;
39pub mod channelarray;
40pub mod channelconversion;
41pub mod channelobserver;
42pub mod etag;
43pub mod event;
44pub mod filehistory;
45pub mod metadata;
46pub mod sourceinformation;
47
48pub use canmessage::{CanMessage, CanMessageRef};
49pub use channel::{Channel, ChannelRef};
50pub use channelgroup::{ChannelGroup, ChannelGroupRef};
51pub use datagroup::{DataGroup, DataGroupRef};
52pub use error::{MdfError, Result};
53pub use file::{MdfFile, MdfFileRef};
54pub use header::{MdfHeader, MdfHeaderRef};
55pub use reader::MdfReader;
56pub use writer::{MdfWriter, MdfWriterType};
57
58// Re-export new MDF object types
59pub use attachment::{Attachment, AttachmentRef};
60pub use canbusobserver::{create_can_bus_observer, CanBusObserver, CanBusObserverRef};
61pub use channelarray::{ChannelArray, ChannelArrayRef};
62pub use channelconversion::{ChannelConversion, ChannelConversionRef};
63pub use channelobserver::{create_channel_observer, ChannelObserver, ChannelObserverRef};
64pub use etag::{ETag, ETagRef};
65pub use event::{Event, EventRef};
66pub use filehistory::{FileHistory, FileHistoryRef};
67pub use log::{log_callback, set_log_callback_1};
68pub use metadata::{MetaData, MetaDataRef};
69pub use sourceinformation::{SourceInformation, SourceInformationRef};