/// Returns the length of the string.
#[gen_stub_pyfunction]
#[pyfunction]
fn f(x: &str) -> PyResult<usize> {
Ok(x.len())
}
results in
error[E0277]: the trait bound `&str: pyo3::FromPyObject<'_>` is not satisfied
--> pyo3-stub-gen-testing-pure/src/lib.rs:24:9
|
24 | fn f(x: &str) -> PyResult<usize> {
| ^^^^ the trait `PyClass` is not implemented for `&str`, which is required by `&str: pyo3::FromPyObject<'_>`
|
= help: the following other types implement trait `pyo3::FromPyObject<'py>`:
<(T0, T1) as pyo3::FromPyObject<'py>>
<(T0, T1, T2) as pyo3::FromPyObject<'py>>
<(T0, T1, T2, T3) as pyo3::FromPyObject<'py>>
<(T0, T1, T2, T3, T4) as pyo3::FromPyObject<'py>>
<(T0, T1, T2, T3, T4, T5) as pyo3::FromPyObject<'py>>
<(T0, T1, T2, T3, T4, T5, T6) as pyo3::FromPyObject<'py>>
<(T0, T1, T2, T3, T4, T5, T6, T7) as pyo3::FromPyObject<'py>>
<(T0, T1, T2, T3, T4, T5, T6, T7, T8) as pyo3::FromPyObject<'py>>
and 53 others
= note: required for `&str` to implement `pyo3::FromPyObject<'_>`
results in