[−][src]Struct rustypy::pytypes::pylist::PyList
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]
T: From<PyArg>,
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]
T: From<PyArg>,
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]
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.
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]
PyArg: From<T>,
impl<T> FromIterator<T> for PyList where
PyArg: From<T>,
[src]
PyArg: From<T>,
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
[src]
impl Index<usize> for PyList
[src]
impl<'a> IndexMut<usize> for PyList
[src]
impl<T> Into<Vec<T>> for PyList where
PyArg: Into<T>,
[src]
PyArg: Into<T>,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,