< 返回版块

麦田守望者 发表于 2020-12-09 18:29

A macro used to make struct's fields public

How to use it?

#[macro_use]
extern crate public;

#[make_public(crate)]
#[derive(Debug, Default)]
struct Foo {
    a: i8,
    b: char,
    c: String,
}

the struct Foo and its fields will be accessible in current crate globally.

欢迎star和使用。


Ext Link: https://github.com/yuchunzhou/public

评论区

写评论

还没有评论

1 共 0 条评论, 1 页