Crates.io | dmxparser |
lib.rs | dmxparser |
version | 0.1.0 |
source | src |
created_at | 2020-12-05 15:52:41.234427 |
updated_at | 2020-12-05 15:52:41.234427 |
description | Reading the Valve Data Model eXchange (DMX) format |
homepage | |
repository | |
max_upload_size | |
id | 319856 |
size | 237,800 |
Reading the Valve Data Model eXchange (DMX) format in Rust
This library is split into 3 parts:
File
structure following closely the in-memory layout of the data. This API exists in two versions, the streaming dmxparser::from_reader(impl BufRead) -> File
returning an owned version of the data, and the non-streaming dmxparser::from_slice(&[u8]) -> File
returning a borrowed version of the data from the original bufferserde::Deserializer
implementation in dmxparser::serde::from_file<T: Deserialize>(File) -> T
that reads any deserializable data structure from a File
returned by the low-level readerdmxparser::formats::vmap::read_vmap(File) -> CMapRootElement
At the moment this library:
Deserializer
implementation, it's been tested on the VMAP structure but other formats might not work properlyAll of this may eventually get fixed in a future (valve) time, but feel free to open a pull request if you want to help
The crate has a dynamic test suite that generates test cases dynamically based on a fixtures
directory containing map files to be loaded. It defaults to using the tests/fixtures
directory but can be pointed at the map directory of a game whose maps can obviously not be included here for copyright reasons to test the library on real data with cargo test --test reader -- --fixtures "D:/SteamLibrary/steamapps/common/Half-Life Alyx/content"
. Note that map files from retail games can be huge, and it can be necessary to disable the parallel execution of tests with --test-threads 1
to prevent too many maps being loaded at the same time and running out of memory.