Hide some implementation detail-y things.

This commit is contained in:
mejrs 2021-09-23 01:10:11 +02:00
parent 55ff51307d
commit ffbc3576c2
2 changed files with 9 additions and 0 deletions

View File

@ -8,6 +8,7 @@ use std::ops;
use std::os::raw::c_char;
/// The boilerplate to convert between a Rust type and a Python exception.
#[doc(hidden)]
#[macro_export]
macro_rules! impl_exception_boilerplate {
($name: ident) => {
@ -158,6 +159,7 @@ macro_rules! create_exception {
/// `impl $crate::type_object::PyTypeObject for $name` where `$name` is an
/// exception newly defined in Rust code.
#[doc(hidden)]
#[macro_export]
macro_rules! create_exception_type_object {
($module: ident, $name: ident, $base: ty) => {

View File

@ -30,6 +30,7 @@ pub use self::tuple::PyTuple;
pub use self::typeobject::PyType;
// Implementations core to all native types
#[doc(hidden)]
#[macro_export]
macro_rules! pyobject_native_type_base(
($name:ty $(;$generics:ident)* ) => {
@ -75,6 +76,7 @@ macro_rules! pyobject_native_type_base(
// Implementations core to all native types except for PyAny (because they don't
// make sense on PyAny / have different implementations).
#[doc(hidden)]
#[macro_export]
macro_rules! pyobject_native_type_named (
($name:ty $(;$generics:ident)*) => {
@ -129,6 +131,7 @@ macro_rules! pyobject_native_type_named (
};
);
#[doc(hidden)]
#[macro_export]
macro_rules! pyobject_native_type_info(
($name:ty, $typeobject:expr, $module:expr $(, #checkfunction=$checkfunction:path)? $(;$generics:ident)*) => {
@ -159,6 +162,7 @@ macro_rules! pyobject_native_type_info(
// NOTE: This macro is not included in pyobject_native_type_base!
// because rust-numpy has a special implementation.
#[doc(hidden)]
#[macro_export]
macro_rules! pyobject_native_type_extract {
($name:ty $(;$generics:ident)*) => {
@ -171,6 +175,7 @@ macro_rules! pyobject_native_type_extract {
}
/// Declares all of the boilerplate for Python types.
#[doc(hidden)]
#[macro_export]
macro_rules! pyobject_native_type_core {
($name:ty, $typeobject:expr, #module=$module:expr $(, #checkfunction=$checkfunction:path)? $(;$generics:ident)*) => {
@ -183,6 +188,7 @@ macro_rules! pyobject_native_type_core {
};
}
#[doc(hidden)]
#[macro_export]
macro_rules! pyobject_native_type_sized {
($name:ty, $layout:path $(;$generics:ident)*) => {
@ -201,6 +207,7 @@ macro_rules! pyobject_native_type_sized {
/// Declares all of the boilerplate for Python types which can be inherited from (because the exact
/// Python layout is known).
#[doc(hidden)]
#[macro_export]
macro_rules! pyobject_native_type {
($name:ty, $layout:path, $typeobject:expr $(, #module=$module:expr)? $(, #checkfunction=$checkfunction:path)? $(;$generics:ident)*) => {