| Crates.io | coc |
| lib.rs | coc |
| version | 0.1.1 |
| created_at | 2025-03-29 07:39:11.29693+00 |
| updated_at | 2025-03-29 08:11:17.060061+00 |
| description | A useful macro collections for struct |
| homepage | |
| repository | https://github.com/SandmeyerX/coc |
| max_upload_size | |
| id | 1610906 |
| size | 6,608 |
Makes both the struct itself and all its fields publicly accessible.
To expose a struct and its fields outside the current module:
pubpub modifierThis allows external code to:
pub struct Foo {
a: i32,
b: i32,
}
// External code can:
let foo = Foo { a: 2, b: 10 };
assert_eq!(foo.a, 2);
assert_eq!(foo.b, 10);
Struct visibility also depends on parent module's visibility1,4. The containing module must be public to allow cross-module access.
For crate-internal visibility, consider pub(crate) instead1,2.