line_cutter-macros

Crates.ioline_cutter-macros
lib.rsline_cutter-macros
version1.0.1
created_at2025-10-17 16:03:21.203546+00
updated_at2025-10-17 20:45:49.027134+00
descriptionline_cutter's proc-macros
homepagehttps://gitlab.com/brunorobert/line_cutter
repositoryhttps://gitlab.com/brunorobert/line_cutter_macros
max_upload_size
id1887854
size44,818
Bruno Robert (bruno-robert)

documentation

README

line_cutter-macros

Crates.io Documentation

Procedural macro for deriving the PositionalEncoded trait from the line_cutter crate.

⚠️ Direct Usage Not Recommended

This crate provides the #[derive(PositionalText)] procedural macro. You should not add this crate as a direct dependency.

Instead, use the main line_cutter crate, which re-exports this derive macro:

[dependencies]
line_cutter = "1.0"

What This Macro Does

The PositionalText derive macro automatically implements the PositionalEncoded trait for structs with fixed-width positional text fields. It generates:

  • decode() - Parse fixed-width strings into structured data
  • encode() - Convert structured data back to fixed-width strings
  • validate() - Validate field values before encoding

Example

use line_cutter::PositionalText;

#[derive(PositionalText)]
pub struct MyRecord {
    #[positional_field(start = 1, size = 10)]
    name: String,

    #[positional_field(start = 11, size = 8)]
    date: chrono::NaiveDate,
}

Documentation

For complete documentation, usage examples, and supported types, see the main line_cutter crate.

License

Licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 0

cargo fmt