Mark protocols setters as doc(hidden)

This commit is contained in:
kngwyu 2020-06-17 02:19:02 +09:00
parent f7fa008159
commit 2a69367888
9 changed files with 12 additions and 1 deletions

View file

@ -153,6 +153,7 @@ pub struct PyObjectMethods {
pub nb_bool: Option<ffi::inquiry>,
}
#[doc(hidden)]
impl PyObjectMethods {
pub(crate) fn update_typeobj(&self, type_object: &mut ffi::PyTypeObject) {
type_object.tp_str = self.tp_str;
@ -162,7 +163,7 @@ impl PyObjectMethods {
type_object.tp_richcompare = self.tp_richcompare;
type_object.tp_setattro = self.tp_setattro;
}
// Set functions used by `#[pyproto]`.
pub fn set_str<T>(&mut self)
where
T: for<'p> PyObjectStrProtocol<'p>,

View file

@ -40,6 +40,8 @@ pub trait PyBufferReleaseBufferProtocol<'p>: PyBufferProtocol<'p> {
type Result: Into<PyResult<()>>;
}
/// Set functions used by `#[pyproto]`.
#[doc(hidden)]
impl PyBufferProcs {
pub fn set_getbuffer<T>(&mut self)
where

View file

@ -71,12 +71,14 @@ pub trait PyDescrSetNameProtocol<'p>: PyDescrProtocol<'p> {
type Result: Into<PyResult<()>>;
}
/// All FFI functions for description protocols.
#[derive(Default)]
pub struct PyDescrMethods {
pub tp_descr_get: Option<ffi::descrgetfunc>,
pub tp_descr_set: Option<ffi::descrsetfunc>,
}
#[doc(hidden)]
impl PyDescrMethods {
pub(crate) fn update_typeobj(&self, type_object: &mut ffi::PyTypeObject) {
type_object.tp_descr_get = self.tp_descr_get;

View file

@ -25,6 +25,7 @@ pub struct PyGCMethods {
pub tp_clear: Option<ffi::inquiry>,
}
#[doc(hidden)]
impl PyGCMethods {
pub(crate) fn update_typeobj(&self, type_object: &mut ffi::PyTypeObject) {
type_object.tp_traverse = self.tp_traverse;

View file

@ -46,6 +46,7 @@ pub struct PyIterMethods {
pub tp_iternext: Option<ffi::iternextfunc>,
}
#[doc(hidden)]
impl PyIterMethods {
pub(crate) fn update_typeobj(&self, type_object: &mut ffi::PyTypeObject) {
type_object.tp_iter = self.tp_iter;

View file

@ -74,6 +74,7 @@ pub trait PyMappingReversedProtocol<'p>: PyMappingProtocol<'p> {
type Result: Into<PyResult<Self::Success>>;
}
#[doc(hidden)]
impl ffi::PyMappingMethods {
pub fn set_length<T>(&mut self)
where

View file

@ -615,6 +615,7 @@ pub trait PyNumberIndexProtocol<'p>: PyNumberProtocol<'p> {
type Result: Into<PyResult<Self::Success>>;
}
#[doc(hidden)]
impl ffi::PyNumberMethods {
pub(crate) fn from_nb_bool(nb_bool: ffi::inquiry) -> *mut Self {
let mut nm = ffi::PyNumberMethods_INIT;

View file

@ -89,6 +89,7 @@ pub trait PyAsyncAexitProtocol<'p>: PyAsyncProtocol<'p> {
type Result: Into<PyResult<Self::Success>>;
}
#[doc(hidden)]
impl ffi::PyAsyncMethods {
pub fn set_await<T>(&mut self)
where

View file

@ -126,6 +126,7 @@ pub trait PySequenceInplaceRepeatProtocol<'p>: PySequenceProtocol<'p> + IntoPy<P
type Result: Into<PyResult<Self>>;
}
#[doc(hidden)]
impl ffi::PySequenceMethods {
pub fn set_len<T>(&mut self)
where