anym

Crates.ioanym
lib.rsanym
version0.0.0
sourcesrc
created_at2022-12-03 11:53:18.243509
updated_at2022-12-03 11:53:18.243509
descriptionTo emulate anonymous `struct` in Rust.
homepage
repository
max_upload_size
id729051
size15,634
xian (rueyxian)

documentation

README

anym

To emulate anonymous struct in Rust.

Overview

The library provides convenience macro for creating local struct. The struct generated by the macro does not implement any functionality. It is for grouping data.

use anym::anym;
fn main() {
    let v1 = {
        let (x, y) = coor();
        anym!({ tag: tag(), x, y })
    };

    let v2 = {
        let (x, y) = coor();
        anym!({ tag: tag(), x, y })
    };

    println!("{}: ({}, {})", v1.tag, v1.x, v1.y);
    println!("{}: ({}, {})", v2.tag, v2.x, v2.y);
}

Note

Pretty useless overall. 🤣

Commit count: 0

cargo fmt