Cppmm is our bindings generator. There are some tools in it to aid in creating safe and stable APIs.
[ ] Use CPPMM_RENAME(ctor) for the "main" type constructor.
[ ] Add CPPMM_THROWS for any code that may throw an exception in C++.
FFI Safety Checklist
The Rustonomicon provides useful guides to prevent soundness errors in Rust. The FFI section of the document provides the source for these checklist items.
[ ] Null pointers are properly handled
[ ] Panics in Rust never cross FFI boundary
[ ] Types implement drop trait for C/C++ destructors
[ ] Concurrency is properly managed between Rust and C/C++
[ ] C style strings are converted to CStr or CString
[ ] Wrap non-trivially movable types in a Box
Rust API Guidelines Checklist
The checklist is heavily inspired by The Rust API Guidelines. Please check each item that applies, or note if an item is intentionally skipped (either partially or fully) with the reason.
[ ] Naming(crate aligns with Rust naming conventions)
Data structures do not duplicate derived trait bounds (C-STRUCT-BOUNDS)
[ ] Necessities(to whom they matter, they really matter)
Public dependencies of a stable crate are stable (C-STABLE)
Crate and its dependencies have a permissive license (C-PERMISSIVE)
Testing Checklist
The tests are meant to validate that the wrappers are sound and work as expected. Tests that are designed to exercise code for the wrapped library and not the bindings should be added to the wrapped library instead.
[ ] unsafe {} code is properly sanitized
[ ] All functions are called at least once in tests
[ ] Functions that can round trip data (for example, readers and writers, getters and setters, etc) are verified so that the input and output data are the same (if applicable).
Description
Fixes #.
CPPMM Checklist
Cppmm is our bindings generator. There are some tools in it to aid in creating safe and stable APIs.
CPPMM_RENAME(ctor)
for the "main" type constructor.CPPMM_THROWS
for any code that may throw an exception in C++.FFI Safety Checklist
The Rustonomicon provides useful guides to prevent soundness errors in Rust. The FFI section of the document provides the source for these checklist items.
CStr
orCString
Box
Rust API Guidelines Checklist
The checklist is heavily inspired by The Rust API Guidelines. Please check each item that applies, or note if an item is intentionally skipped (either partially or fully) with the reason.
as_
,to_
,into_
conventions (C-CONV)iter
,iter_mut
,into_iter
(C-ITER)Copy
,Clone
,Eq
,PartialEq
,Ord
,PartialOrd
,Hash
,Debug
,Display
,Default
From
,AsRef
,AsMut
(C-CONV-TRAITS)FromIterator
andExtend
(C-COLLECT)Serialize
,Deserialize
(C-SERDE)Send
andSync
where possible (C-SEND-SYNC)Hex
,Octal
,Binary
formatting (C-NUM-FMT)R: Read
andW: Write
by value (C-RW-VALUE)?
, nottry!
, notunwrap
(C-QUESTION-MARK)Deref
andDerefMut
(C-DEREF)bool
orOption
(C-CUSTOM-TYPE)bitflags
, not enums (C-BITFLAG)Debug
(C-DEBUG)Debug
representation is never empty (C-DEBUG-NONEMPTY)Testing Checklist
The tests are meant to validate that the wrappers are sound and work as expected. Tests that are designed to exercise code for the wrapped library and not the bindings should be added to the wrapped library instead.
unsafe {}
code is properly sanitized