{"id":31846921,"url":"https://github.com/tuna-f1sh/mdflib-rs","last_synced_at":"2026-07-03T16:33:09.830Z","repository":{"id":306441775,"uuid":"1025530449","full_name":"tuna-f1sh/mdflib-rs","owner":"tuna-f1sh","description":"Rust bindings for https://github.com/ihedvall/mdflib","archived":false,"fork":false,"pushed_at":"2026-05-07T06:27:03.000Z","size":247,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-09T22:05:07.950Z","etag":null,"topics":["logging","mdf","mf4"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tuna-f1sh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-24T11:51:27.000Z","updated_at":"2026-05-07T06:28:03.000Z","dependencies_parsed_at":"2025-08-10T17:22:56.959Z","dependency_job_id":"70a723b8-7600-4294-bc60-1f6d70bbda28","html_url":"https://github.com/tuna-f1sh/mdflib-rs","commit_stats":null,"previous_names":["tuna-f1sh/mdflib-rs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tuna-f1sh/mdflib-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuna-f1sh%2Fmdflib-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuna-f1sh%2Fmdflib-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuna-f1sh%2Fmdflib-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuna-f1sh%2Fmdflib-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tuna-f1sh","download_url":"https://codeload.github.com/tuna-f1sh/mdflib-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuna-f1sh%2Fmdflib-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35094063,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-03T02:00:05.635Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["logging","mdf","mf4"],"created_at":"2025-10-12T09:17:46.421Z","updated_at":"2026-07-03T16:33:09.820Z","avatar_url":"https://github.com/tuna-f1sh.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MDFlib Rust Wrapper\n\nA workspace that provides Rust bindings and wrapper code to the [`mdflib`](https://github.com/ihedvall/mdflib) C++ library, enabling you to read and write MDF (Measurement Data Format) files.\n\n## Why not native Rust?\n\nWhile there are MDF libraries available for Rust: [`danielrisca/asammdf`](https://github.com/danielhrisca/asammdf), [`rsmdf`](https://github.com/Liberty009/rsmdf) [`H202-IO/asammdf`](https://github.com/H2O2-IO/asammdf) (looked most viable for development to me), they are either incomplete or lack certain features like write support or bus logging helpers. This library aims to provide a more comprehensive solution by wrapping the feature-rich `mdflib` C++ library.\n\nThis project is intended as a proof of concept and a quick way to get a project that depends on MDF logging up and running. In the long term, the goal is to contribute to the existing Rust MDF libraries and reduce the reliance on the C++ `mdflib`.\n\nIt was also an experiement for me using bindgen and Copilot agent to write some of the wrapper code.\n\n## Prerequisites\n\n[mdflib](https://github.com/ihedvall/mdflib) has the following dependencies:\n\n* **zlib**: A software library used for data compression.\n* **expat**: A stream-oriented XML parser library.\n* **cmake** and **build-essential** (or Apple/Windows build tools): Required for building the C++ library from source.\n\nYou can install these dependencies using your system's package manager.\n\n### Platform-Specific Notes\n\n#### Windows\n\nOn Windows, you have two options:\n\n1. **MSVC toolchain (Recommended)**: Requires Visual Studio 2017 or later with C++ support. Use vcpkg to install dependencies:\n   ```bash\n   vcpkg install zlib:x64-windows expat:x64-windows\n   set VCPKG_ROOT=C:\\path\\to\\vcpkg\n   cargo build\n   ```\n\n2. **GNU toolchain (MinGW)**: Requires MinGW-w64 and dependencies. Use vcpkg with MinGW triplets:\n   ```bash\n   vcpkg install zlib:x64-mingw-static expat:x64-mingw-static\n   set VCPKG_ROOT=C:\\path\\to\\vcpkg\n   rustup target add x86_64-pc-windows-gnu\n   cargo build --target x86_64-pc-windows-gnu\n   ```\n\n#### Linux\n\n```bash\n# Ubuntu/Debian\nsudo apt-get install cmake build-essential libexpat1-dev zlib1g-dev\n\n# Fedora/RHEL\nsudo dnf install cmake gcc-c++ expat-devel zlib-devel\n```\n\n#### macOS\n\n```bash\nbrew install cmake expat zlib\n```\n\n## Usage\n\nReview the [mdflib documentation](https://ihedvall.github.io/mdflib/), the 'mdflib/examples/' and 'mdflib/tests/' directories in this repository.\n\n\u003e [!WARNING]\n\u003e The current implementation is mostly `unsafe` due to the nature of FFI (Foreign Function Interface) with C++. There are also some lifetime privledges taken to allow for full access to the C++ API. Use with caution and ensure you understand the implications of using `unsafe` code in Rust.\n\n### CAN Message Logging with mf4-candump\n\nThe workspace includes `mf4-candump`, a CAN message logger that writes to MF4 files, similar to `candump` but outputting to MDF4 format instead of stdout. It's an example of how to use the `mdflib` Rust bindings to log CAN messages.\n\n```bash\n# Log CAN messages from can0 interface\ncargo run --bin mf4-candump -p mf4-candump can0\n```\n\nSee the [mf4-candump README](mf4-candump/README.md) for detailed usage instructions.\n\n## Building from Source\n\nIf you want to build the library from source, you'll need to have the `mdflib` C++ library available on your system. You can either install it system-wide or use the bundled version.\n\n### Using Bundled `mdflib`\n\nBy default, the build script will attempt to build and link against the bundled `mdflib` source code. This is the recommended approach for most users. Ensure that the repository is cloned with submodules initialized:\n\n```bash\ngit clone --recurse-submodules\n```\n\n### Using System `mdflib`\n\nIf you have `mdflib` installed on your system, you can configure the build to use it instead of the bundled version. This can be useful if you want to use a specific version of `mdflib` or if you have a system-wide installation that you want to link against.\n\n## Contributing\n\nContributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuna-f1sh%2Fmdflib-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftuna-f1sh%2Fmdflib-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuna-f1sh%2Fmdflib-rs/lists"}