Skip to main content

PySliceMethods

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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

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