docs: fix warnings
This commit is contained in:
parent
e245f5239a
commit
3d6356223e
|
@ -84,6 +84,9 @@ jobs:
|
|||
name: Prepare LD_LIBRARY_PATH (Ubuntu only)
|
||||
run: echo LD_LIBRARY_PATH=${pythonLocation}/lib >> $GITHUB_ENV
|
||||
|
||||
- name: Build docs
|
||||
run: cargo doc --features "num-bigint num-complex" --verbose --target ${{ matrix.platform.rust-target }}
|
||||
|
||||
- name: Build without default features
|
||||
run: cargo build --no-default-features --verbose --target ${{ matrix.platform.rust-target }}
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ The `#[pyclass]` macro accepts the following parameters:
|
|||
The performance improvement applies to types that are often created and deleted in a row,
|
||||
so that they can benefit from a freelist. `XXX` is a number of items for the free list.
|
||||
* `gc` - Classes with the `gc` parameter participate in Python garbage collection.
|
||||
If a custom class contains references to other Python objects that can be collected, the [`PyGCProtocol`] trait has to be implemented.
|
||||
If a custom class contains references to other Python objects that can be collected, the [`PyGCProtocol`](https://docs.rs/pyo3/latest/pyo3/class/gc/trait.PyGCProtocol.html) trait has to be implemented.
|
||||
* `weakref` - Adds support for Python weak references.
|
||||
* `extends=BaseType` - Use a custom base class. The base `BaseType` must implement `PyTypeInfo`.
|
||||
* `subclass` - Allows Python classes to inherit from this class.
|
||||
|
|
|
@ -225,3 +225,4 @@ defines exceptions for several standard library modules.
|
|||
[`PyErr`]: https://docs.rs/pyo3/latest/pyo3/struct.PyErr.html
|
||||
[`PyErr::from_instance`]: https://docs.rs/pyo3/latest/pyo3/struct.PyErr.html#method.from_instance
|
||||
[`Python::is_instance`]: https://docs.rs/pyo3/latest/pyo3/struct.Python.html#method.is_instance
|
||||
[`PyAny::is_instance`]: https://docs.rs/pyo3/latest/pyo3/struct.PyAny.html#method.is_instance
|
||||
|
|
|
@ -182,8 +182,8 @@ the following:
|
|||
|
||||
### Calling Python functions in Rust
|
||||
|
||||
You can pass Python `def`'d functions and built-in functions to Rust functions `[PyFunction]`
|
||||
corresponds to regular Python functions while `[PyCFunction]` describes built-ins such as
|
||||
You can pass Python `def`'d functions and built-in functions to Rust functions [`PyFunction`]
|
||||
corresponds to regular Python functions while [`PyCFunction`] describes built-ins such as
|
||||
`repr()`.
|
||||
|
||||
You can also use [`PyAny::is_callable`] to check if you have a callable object. `is_callable` will
|
||||
|
@ -208,6 +208,8 @@ in Python code.
|
|||
[`PyAny::call1`]: https://docs.rs/pyo3/latest/pyo3/struct.PyAny.html#tymethod.call1
|
||||
[`PyObject`]: https://docs.rs/pyo3/latest/pyo3/type.PyObject.html
|
||||
[`wrap_pyfunction!`]: https://docs.rs/pyo3/latest/pyo3/macro.wrap_pyfunction.html
|
||||
[`PyFunction`]: https://docs.rs/pyo3/0.12.4/pyo3/types/struct.PyFunction.html
|
||||
[`PyCFunction`]: https://docs.rs/pyo3/0.12.4/pyo3/types/struct.PyCFunction.html
|
||||
|
||||
### Accessing the module of a function
|
||||
|
||||
|
|
|
@ -212,7 +212,7 @@ impl PyModule {
|
|||
/// ```
|
||||
///
|
||||
/// **This function will be deprecated in the next release. Please use the specific
|
||||
/// [add_function] and [add_submodule] functions instead.**
|
||||
/// [PyModule::add_function] and [PyModule::add_submodule] functions instead.**
|
||||
pub fn add_wrapped<'a, T>(&'a self, wrapper: &impl Fn(Python<'a>) -> T) -> PyResult<()>
|
||||
where
|
||||
T: IntoPyCallbackOutput<PyObject>,
|
||||
|
|
Loading…
Reference in New Issue