[][src]Struct rustypy::pytypes::pylist::PyList

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]

pub fn new() -> PyList[src]

Constructs a new, empty PyList<T>.

The vector will not allocate until elements are pushed onto it.

pub fn remove<T>(&mut self, index: usize) -> T where
    T: From<PyArg>, 
[src]

Removes and returns the element at position index within the vector, shifting all elements after it to the left.

pub fn pop<T>(&mut self) -> Option<T> where
    T: From<PyArg>, 
[src]

Removes the last element from a vector and returns it, or None if it is empty.

pub fn len(&self) -> usize[src]

Returns the number of elements in the PyList.

pub fn is_empty(&self) -> bool[src]

pub fn push<T>(&mut self, a: T) where
    PyArg: From<T>, 
[src]

Appends an element to the back of a collection.

##Panics

Panics if the number of elements in the vector overflows a usize.

pub unsafe fn from_ptr(ptr: *mut PyList) -> PyList[src]

Get a PyList from a previously boxed raw pointer.

pub fn into_raw(self) -> *mut PyList[src]

Return a PyList as a raw pointer.

pub fn speciallized_iter<T: From<PyArg>>(self) -> IntoIter<T>[src]

Consume self and turn it into an iterator.

Trait Implementations

impl AsRef<PyList> for PyArg[src]

impl Clone for PyList[src]

impl Debug for PyList[src]

impl Default for PyList[src]

impl From<PyArg> for PyList[src]

impl From<PyList> for PyArg[src]

impl<T> From<Vec<T>> for PyList where
    PyArg: From<T>, 
[src]

impl<T> FromIterator<T> for PyList where
    PyArg: From<T>, 
[src]

impl Index<usize> for PyList[src]

type Output = PyArg

The returned type after indexing.

impl<'a> IndexMut<usize> for PyList[src]

impl<T> Into<Vec<T>> for PyList where
    PyArg: Into<T>, 
[src]

impl PartialEq<PyList> for PyList[src]

impl StructuralPartialEq for PyList[src]

Auto Trait Implementations

impl RefUnwindSafe for PyList

impl !Send for PyList

impl !Sync for PyList

impl Unpin for PyList

impl UnwindSafe for PyList

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.