Skip to content

Commit

Permalink
Mark protocols setters as doc(hidden)
Browse files Browse the repository at this point in the history
  • Loading branch information
kngwyu committed Jun 16, 2020
1 parent f7fa008 commit 2a69367
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/class/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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>,
Expand Down
2 changes: 2 additions & 0 deletions src/class/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/class/descr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/class/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/class/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/class/mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/class/number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/class/pyasync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/class/sequence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2a69367

Please sign in to comment.