api-guidelines icon indicating copy to clipboard operation
api-guidelines copied to clipboard

Naming for hidden items that have to be public

Open kgv opened this issue 3 years ago • 0 comments

For example, if we want to use structure fields or some function inside a macro but don't want them to be part of the API, we mark them as hidden.

pub struct Struct {
    /// This is an implementation detail and **should not** be used directly!
    #[doc(hidden)]
    pub __field: u8,
}

I think it would be useful to specify a naming convention for these cases.

Relevant links:

What does it signify to precede a variable name with two underscores? __var Down a Rusty Rabbit Hole

kgv avatar Jun 10 '21 13:06 kgv