Move Opaque and Trivial marker types under a ::kind module
In the interest of keeping the root module focused on the most widely
used items only.
diff --git a/src/extern_type.rs b/src/extern_type.rs
index 9bc5947..d35b690 100644
--- a/src/extern_type.rs
+++ b/src/extern_type.rs
@@ -69,11 +69,11 @@
/// # pub struct StringPiece([usize; 2]);
/// # }
///
-/// use cxx::{type_id, ExternType, Opaque};
+/// use cxx::{type_id, ExternType};
///
/// unsafe impl ExternType for folly_sys::StringPiece {
/// type Id = type_id!("folly::StringPiece");
-/// type Kind = Opaque;
+/// type Kind = cxx::kind::Opaque;
/// }
///
/// #[cxx::bridge(namespace = folly)]
@@ -105,7 +105,7 @@
/// # struct TypeName;
/// # unsafe impl cxx::ExternType for TypeName {
/// type Id = cxx::type_id!("name::space::of::TypeName");
-/// type Kind = cxx::Trivial;
+/// type Kind = cxx::kind::Trivial;
/// # }
/// ```
/// which will enable you to pass it into C++ functions by value,
@@ -125,18 +125,17 @@
/// # struct TypeName;
/// # unsafe impl cxx::ExternType for TypeName {
/// type Id = cxx::type_id!("name::space::of::TypeName");
- /// type Kind = cxx::Opaque;
+ /// type Kind = cxx::kind::Opaque;
/// # }
/// ```
type Id;
- /// Either `cxx::Opaque` or `cxx::Trivial`. If in doubt, use
- /// `cxx::Opaque`.
+ /// Either `cxx::kind::Opaque` or `cxx::kind::Trivial`. If in doubt, use
+ /// `cxx::kind::Opaque`.
type Kind;
}
-pub(crate) mod kind {
-
+pub mod kind {
/// An opaque type which can't be passed or held by value within Rust.
/// For example, a C++ type with a destructor, or a non-trivial move
/// constructor. Rust's strict move semantics mean that we can't own
diff --git a/src/lib.rs b/src/lib.rs
index b53a7b6..815eacf 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -395,9 +395,7 @@
pub use crate::cxx_string::CxxString;
pub use crate::cxx_vector::CxxVector;
pub use crate::exception::Exception;
-pub use crate::extern_type::kind::Opaque;
-pub use crate::extern_type::kind::Trivial;
-pub use crate::extern_type::ExternType;
+pub use crate::extern_type::{kind, ExternType};
pub use crate::unique_ptr::UniquePtr;
pub use cxxbridge_macro::bridge;