Expand description
§mnk-vmf
A fast parser for Valve Map Format (VMF) files used in Source engine.
This crate provides efficient parsing of VMF files into a strongly-typed AST, with support for all major VMF constructs including worlds, entities, solids, displacements, and more.
§Quick Start
ⓘ
use mnk_vmf::VMF;
let vmf = VMF::open("mymap.vmf")?;
let data = vmf.parse()?;
for block in data {
match block {
mnk_vmf::VMFValue::World(world) => {
println!("World has {} solids", world.solids.len());
}
mnk_vmf::VMFValue::Entity(entity) => {
println!("Entity: {}", entity.classname);
}
_ => {}
}
}§Features
- Fast parsing: Uses Chumsky parser combinators for efficient token-based parsing
- Complete VMF support: Handles versioninfo, visgroups, worlds, entities, solids, displacements, cameras, and more
- Strong typing: All VMF constructs are represented as Rust types with proper error handling
§Modules
Re-exports§
pub use vmf::*;
Modules§
Macros§
- impl_
block_ properties_ parser - Macro to define individual property parsers and combine them with .or(). When this Macro is used, it is necrssary to have chumsky’s .or() and .map() in the scope.
Traits§
- Parser
- A trait that should be implemented on all VMF block types.