3 releases (breaking)

0.3.0 Feb 11, 2023
0.2.2 Feb 11, 2023
0.2.1 Jan 24, 2023
0.2.0 Jan 23, 2023
0.1.0 Jan 11, 2023

#874 in Procedural macros

Download history 631/week @ 2024-11-15 1497/week @ 2024-11-22 1198/week @ 2024-11-29 1310/week @ 2024-12-06 1485/week @ 2024-12-13 505/week @ 2024-12-20 289/week @ 2024-12-27 1062/week @ 2025-01-03 902/week @ 2025-01-10 1280/week @ 2025-01-17 859/week @ 2025-01-24 1616/week @ 2025-01-31 2293/week @ 2025-02-07 1411/week @ 2025-02-14 1497/week @ 2025-02-21 817/week @ 2025-02-28

6,336 downloads per month
Used in 6 crates (via forest-filecoin)

MIT license

16KB
344 lines

cfg-vis

A macro to support #[cfg()] on visibility.

use cfg_vis::{cfg_vis, cfg_vis_fields};

// default visibility is `pub`, while the target is linux, the visibility is `pub(crate)`.
#[cfg_vis(target_os = "linux", pub(crate))]
pub fn foo() {}

#[cfg_vis_fields]
pub struct Foo {
    #[cfg_vis(test, pub)]
    pub_in_test: i32,
    #[cfg_vis(test)]
    pub prv_in_test: i32,
}

Dependencies

~4MB
~88K SLoC