Struct rustypy::pytypes::pylist::PyList
[−]
[src]
pub struct PyList { /* fields omitted */ }
An analog of a Python list which contains an undefined number of elements of a single kind, of any supported type.
Read the module docs for more information.
Methods
impl PyList
[src]
fn new() -> PyList
Constructs a new, empty PyList<T>
.
The vector will not allocate until elements are pushed onto it.
fn remove<T>(&mut self, index: usize) -> T where
T: From<PyArg>,
T: From<PyArg>,
Removes and returns the element at position index
within the vector,
shifting all elements after it to the left.
fn pop<T>(&mut self) -> Option<T> where
T: From<PyArg>,
T: From<PyArg>,
Removes the last element from a vector and returns it, or None
if it is empty.
fn len(&self) -> usize
Returns the number of elements in the PyList.
fn push<T>(&mut self, a: T) where
PyArg: From<T>,
PyArg: From<T>,
Appends an element to the back of a collection.
Panics
Panics if the number of elements in the vector overflows a usize.
unsafe fn from_ptr(ptr: *mut PyList) -> PyList
Get a PyList from a previously boxed raw pointer.
fn as_ptr(self) -> *mut PyList
Return a PyList as a raw pointer.
fn into_iter<T: From<PyArg>>(self) -> IntoIter<T>
Consume self and turn it into an iterator.
Trait Implementations
impl Clone for PyList
[src]
fn clone(&self) -> PyList
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for PyList
[src]
impl PartialEq for PyList
[src]
fn eq(&self, __arg_0: &PyList) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &PyList) -> bool
This method tests for !=
.
impl<T> FromIterator<T> for PyList where
PyArg: From<T>,
[src]
PyArg: From<T>,
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
impl<T> Into<Vec<T>> for PyList where
PyArg: Into<T>,
[src]
PyArg: Into<T>,
impl<T> From<Vec<T>> for PyList where
PyArg: From<T>,
[src]
PyArg: From<T>,
impl Index<usize> for PyList
[src]
type Output = PyArg
The returned type after indexing
fn index(&self, index: usize) -> &PyArg
The method for the indexing (container[index]
) operation
impl<'a> IndexMut<usize> for PyList
[src]
fn index_mut(&mut self, index: usize) -> &mut PyArg
The method for the mutable indexing (container[index]
) operation