devela::_dep::pyo3::prelude

Trait PySliceMethods

pub trait PySliceMethods<'py>: Sealed {
    // Required method
    fn indices(&self, length: isize) -> Result<PySliceIndices, PyErr> ;
}
Available on crate features dep_pyo3 and std only.
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) -> Result<PySliceIndices, PyErr>

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§

§

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