vis 0.0.1

Set default visibility for struct fields
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 4.6 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 116.34 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4s Average build duration of successful builds.
  • all releases: 5s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • peeqle/vis
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • peeqle

vis

Procedural macro for setting default scope for struct fields

Example 1

use vis::vis;

#[vis(pub)]
pub struct Db {
    count: u8,
    url: String,
    port: u16, 
    password: String,
    username: String,
    tables: Vec<String>,
    indexes: Vec<Index>,
    ...
}

Result 1

pub struct Db {
    pub count: u8,
    pub url: String,
    pub port: u16,
    pub password: String,
    pub username: String,
    pub tables: Vec<String>,
    pub indexes: Vec<Index>,
}

Example 2

use vis::vis;

#[vis(pub(crate))]
pub struct Db {
    count: u8,
    pub url: String,
    pub port: u16,
    password: String,
    username: String,
    tables: Vec<String>,
    indexes: Vec<Index>,
    ...
}

Result 2

pub struct Db {
    pub(crate) count: u8,
    pub url: String,
    pub port: u16,
    pub(crate) password: String,
    pub(crate) username: String,
    pub(crate) tables: Vec<String>,
    pub(crate) indexes: Vec<Index>,
    ...
}