| Crates.io | versatiles_derive |
| lib.rs | versatiles_derive |
| version | 3.4.0 |
| created_at | 2024-05-27 12:00:11.41499+00 |
| updated_at | 2026-01-23 14:40:17.341825+00 |
| description | A toolbox for converting, checking and serving map tiles in various formats. |
| homepage | https://versatiles.org |
| repository | https://github.com/versatiles-org/versatiles-rs |
| max_upload_size | |
| id | 1253309 |
| size | 42,355 |
Procedural macros for the VersaTiles ecosystem.
This crate provides derive macros and attribute macros used internally by VersaTiles for code generation and ergonomic error handling.
#[derive(VPLDecode)]: Automatically generates decoding logic for VPL (VersaTiles Pipeline Language) data structures#[derive(ConfigDoc)]: Generates YAML configuration documentation from struct definitions#[context("...")]: Adds contextual error messages to functions returning ResultThis crate is primarily for internal use within the VersaTiles project. If you're using VersaTiles as a library, you typically won't need to use this crate directly.
cargo add versatiles_derive
Or see crates.io/crates/versatiles_derive for version info and docs.rs/versatiles_derive for API documentation.
use versatiles_derive::{VPLDecode, context};
use anyhow::Result;
#[derive(VPLDecode)]
struct MyConfig {
name: String,
value: u32,
}
#[context("failed to process data")]
fn process() -> Result<()> {
// Errors will include "failed to process data" context
Ok(())
}
For detailed API documentation and macro usage, see docs.rs/versatiles_derive.
This crate is part of the VersaTiles project.
MIT License - see LICENSE for details.