rust: fix private type in public API, repr(C), lint name