Skip to content

Commit b6befcf

Browse files
committed
CHANGELOG and better docs for PyMethodsImpl
1 parent 816c50a commit b6befcf

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2424
* `&'static Py~` being allowed as arguments. [#869](https://github.com/PyO3/pyo3/pull/869)
2525
* `#[pyo3(get)]` for `Py<T>`. [#880](https://github.com/PyO3/pyo3/pull/880)
2626

27+
### Removed
28+
* `PyMethodsProtocol` is now renamed to `PyMethodsImpl` and hidden. [#889](https://github.com/PyO3/pyo3/pull/889)
29+
2730

2831
## [0.9.2]
2932

src/class/methods.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ impl PySetterDef {
115115
}
116116
}
117117

118-
#[doc(hidden)] // Only to be used through the proc macros
119-
/// Allows arbitrary pymethod blocks to submit their methods, which are eventually collected by pyclass
118+
/// Implementation detail. Only to be used through the proc macros.
119+
/// Allows arbitrary pymethod blocks to submit their methods, which are eventually
120+
/// collected by pyclass.
121+
#[doc(hidden)]
120122
pub trait PyMethodsInventory: inventory::Collect {
121123
/// Create a new instance
122124
fn new(methods: &'static [PyMethodDefType]) -> Self;
@@ -125,13 +127,14 @@ pub trait PyMethodsInventory: inventory::Collect {
125127
fn get_methods(&self) -> &'static [PyMethodDefType];
126128
}
127129

128-
#[doc(hidden)] // Only to be used through the proc macros
130+
/// Implementation detail. Only to be used through the proc macros.
129131
/// For pyclass derived structs, this trait collects method from all impl blocks using inventory.
132+
#[doc(hidden)]
130133
pub trait PyMethodsImpl {
131-
/// Normal methods, mainly defined by `#[pymethod]`.
134+
/// Normal methods. Mainly defined by `#[pymethod]`.
132135
type Methods: PyMethodsInventory;
133136

134-
/// Returns all methods that are defined for a class
137+
/// Returns all methods that are defined for a class.
135138
fn py_methods() -> Vec<&'static PyMethodDefType> {
136139
inventory::iter::<Self::Methods>
137140
.into_iter()

0 commit comments

Comments
 (0)