Trait pyo3::prelude::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§


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.



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