diff options
Diffstat (limited to 'CONVENTIONS.md')
-rw-r--r-- | CONVENTIONS.md | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/CONVENTIONS.md b/CONVENTIONS.md index 3b0a0875..068f1e45 100644 --- a/CONVENTIONS.md +++ b/CONVENTIONS.md @@ -19,7 +19,18 @@ We use the functions exported from [libc][libc] instead of writing our own `extern` declarations. We use the `struct` definitions from [libc][libc] internally instead of writing -our own. +our own. If we want to add methods to a libc type, we use the newtype pattern. +For example, + +```rust +pub struct SigSet(libc::sigset_t); + +impl SigSet { + ... +} +``` + +When creating newtypes, we use Rust's `CamelCase` type naming convention. ## Bitflags |