| 1 | compat_functionrust-analyzer cargo pyo3-ffi 0.28.2 compat/compat_function!!( |
| 2 | originally_defined_for(all(Py_3_14, not(Py_LIMITED_API))); |
| 3 | |
| 4 | #[inline] |
| 5 | pub unsafe fn Py_HashBufferrust-analyzer cargo pyo3-ffi 0.28.2 compat/py_3_14/Py_HashBuffer().( |
| 6 | ptr: *const stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::ffirust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/::c_voidrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/c_void#, |
| 7 | len: craterust-analyzer cargo pyo3-ffi 0.28.2 crate/::Py_ssize_trust-analyzer cargo pyo3-ffi 0.28.2 pyport/Py_ssize_t#, |
| 8 | ) -> craterust-analyzer cargo pyo3-ffi 0.28.2 crate/::Py_hash_trust-analyzer cargo pyo3-ffi 0.28.2 pyport/Py_hash_t# { |
| 9 | #[cfg(not(any(Py_LIMITED_API, PyPy)))] |
| 10 | { |
| 11 | craterust-analyzer cargo pyo3-ffi 0.28.2 crate/::_Py_HashBytes(ptr, len) |
| 12 | } |
| 13 | |
| 14 | #[cfg(any(Py_LIMITED_API, PyPy))] |
| 15 | { |
| 16 | let bytes = craterust-analyzer cargo pyo3-ffi 0.28.2 crate/::PyBytes_FromStringAndSizerust-analyzer cargo pyo3-ffi 0.28.2 PyBytes_FromStringAndSize().(ptr as *const stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::ffirust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/::c_charrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_char#, len); |
| 17 | if bytes.is_nullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/mut_ptr/impl#[`*mut T`]is_null().() { |
| 18 | -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[isize][Neg]neg().1 |
| 19 | } else { |
| 20 | let result = craterust-analyzer cargo pyo3-ffi 0.28.2 crate/::PyObject_Hashrust-analyzer cargo pyo3-ffi 0.28.2 PyObject_Hash().(bytes); |
| 21 | craterust-analyzer cargo pyo3-ffi 0.28.2 crate/::Py_DECREFrust-analyzer cargo pyo3-ffi 0.28.2 refcount/Py_DECREF().(bytes); |
| 22 | result |
| 23 | } |
| 24 | } |
| 25 | } |
| 26 | ); |
| 27 | |
| 28 | compat_functionrust-analyzer cargo pyo3-ffi 0.28.2 compat/compat_function!!( |
| 29 | originally_defined_for(Py_3_14); |
| 30 | |
| 31 | #[inline] |
| 32 | pub unsafe fn PyIter_NextItemrust-analyzer cargo pyo3-ffi 0.28.2 compat/py_3_14/PyIter_NextItem().( |
| 33 | iter: *mut craterust-analyzer cargo pyo3-ffi 0.28.2 crate/::PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#, |
| 34 | item: *mut *mut craterust-analyzer cargo pyo3-ffi 0.28.2 crate/::PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#, |
| 35 | ) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::ffirust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/::c_intrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_int# { |
| 36 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#deref().item = craterust-analyzer cargo pyo3-ffi 0.28.2 crate/::PyIter_Nextrust-analyzer cargo pyo3-ffi 0.28.2 PyIter_Next().(iter); |
| 37 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#deref().item).is_nullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/mut_ptr/impl#[`*mut T`]is_null().() { |
| 38 | 1 |
| 39 | } else if craterust-analyzer cargo pyo3-ffi 0.28.2 crate/::PyErr_Occurredrust-analyzer cargo pyo3-ffi 0.28.2 PyErr_Occurred().().is_nullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/mut_ptr/impl#[`*mut T`]is_null().() { |
| 40 | 0 |
| 41 | } else { |
| 42 | -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().1 |
| 43 | } |
| 44 | } |
| 45 | ); |