pyo3::types::slice

Trait PySliceMethods

Source
pub trait PySliceMethods<'py>: Sealed {
    // Required method
    fn indices(&self, length: isize) -> PyResult<PySliceIndices>;
}
Expand description

Implementation of functionality for PySlice.

These methods are defined for the Bound<'py, PyTuple> smart pointer, so to use method call syntax these methods are separated into a trait, because stable Rust does not yet support arbitrary_self_types.

Required Methods§

Source

fn indices(&self, length: isize) -> PyResult<PySliceIndices>

Retrieves the start, stop, and step indices from the slice object, assuming a sequence of length length, and stores the length of the slice in its slicelength member.

Implementors§

Source§

impl<'py> PySliceMethods<'py> for Bound<'py, PySlice>

⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here