Trait PythonizeListType

Source
pub trait PythonizeListType: Sized {
    // Required method
    fn create_sequence<'py, T, U>(
        py: Python<'py>,
        elements: impl IntoIterator<Item = T, IntoIter = U>,
    ) -> PyResult<Bound<'py, PySequence>>
       where T: IntoPyObject<'py>,
             U: ExactSizeIterator<Item = T>;
}
Expand description

Trait for types which can represent a Python sequence

Required Methods§

Source

fn create_sequence<'py, T, U>( py: Python<'py>, elements: impl IntoIterator<Item = T, IntoIter = U>, ) -> PyResult<Bound<'py, PySequence>>
where T: IntoPyObject<'py>, U: ExactSizeIterator<Item = T>,

Constructor

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl PythonizeListType for PyList

Source§

fn create_sequence<'py, T, U>( py: Python<'py>, elements: impl IntoIterator<Item = T, IntoIter = U>, ) -> PyResult<Bound<'py, PySequence>>
where T: IntoPyObject<'py>, U: ExactSizeIterator<Item = T>,

Source§

impl PythonizeListType for PyTuple

Source§

fn create_sequence<'py, T, U>( py: Python<'py>, elements: impl IntoIterator<Item = T, IntoIter = U>, ) -> PyResult<Bound<'py, PySequence>>
where T: IntoPyObject<'py>, U: ExactSizeIterator<Item = T>,

Implementors§