Skip to main content

igraph_matrix_list_t

Struct igraph_matrix_list_t 

Source
pub struct igraph_matrix_list_t { /* private fields */ }

Implementations§

Source§

impl igraph_matrix_list_t

Source

pub fn new() -> Self

Creates an empty list (igraph_*_list_init).

Source

pub fn len(&self) -> usize

Number of items.

Source

pub fn is_empty(&self) -> bool

Whether the list is empty.

Source

pub fn as_slice(&self) -> &[igraph_matrix_t]

The items as a slice of the C item type.

Source

pub fn as_mut_slice(&mut self) -> &mut [igraph_matrix_t]

The items as a mutable slice of the C item type.

Source

pub fn get(&self, index: usize) -> Option<&igraph_matrix_t>

The item at index, if any.

Source

pub fn iter(&self) -> Iter<'_, igraph_matrix_t>

Iterates over the items by reference.

Source

pub fn push(&mut self, item: igraph_matrix_t)

Appends an item, transferring its ownership to the list (igraph_*_list_push_back).

Source

pub fn pop(&mut self) -> Option<igraph_matrix_t>

Removes and returns the last item, if any; the caller owns it (igraph_*_list_pop_back).

Source

pub fn remove(&mut self, index: usize) -> igraph_matrix_t

Removes the item at index, shifting the following ones, and returns it (ownership is transferred back to the caller) (igraph_*_list_remove).

§Panics

If index >= len.

Source

pub fn into_vec(self) -> Vec<igraph_matrix_t>

Converts into a Vec of owned items, without copying them.

Source§

impl igraph_matrix_list_t

Source

pub fn insert(&mut self, pos: usize, item: igraph_matrix_t)

Inserts item at position pos, shifting the following items; the list takes ownership of it (igraph_*_list_insert).

§Panics

If pos > len.

Source

pub fn replace(&mut self, pos: usize, item: igraph_matrix_t) -> igraph_matrix_t

Replaces the item at pos with item, returning the old one (igraph_*_list_replace).

§Panics

If pos >= len.

Source

pub fn swap_remove(&mut self, pos: usize) -> igraph_matrix_t

Removes the item at pos in O(1), moving the last item into its place, and returns it (igraph_*_list_remove_fast).

§Panics

If pos >= len.

Source

pub fn clear(&mut self)

Destroys all the items, keeping the storage (igraph_*_list_clear).

Source

pub fn truncate(&mut self, len: usize)

Keeps the first len items, destroying the others.

Source

pub fn reverse(&mut self)

Reverses the order of the items (igraph_*_list_reverse, undocumented in igraph_vector_list.h).

Source

pub fn swap(&mut self, i: usize, j: usize)

Swaps the items at positions i and j (igraph_*_list_swap_elements).

§Panics

If an index is out of bounds.

Source

pub fn permute(&mut self, index: &[igraph_int_t]) -> Result<()>

Reorders the items so that the item at index[i] moves to position i (igraph_*_list_permute).

§Errors

ErrorKind::InvalidValue unless index is a permutation of 0..len (igraph 1.0.0 and 1.0.1 do not check it, and would leak or double free items with an invalid one).

Source

pub fn sort_by( &mut self, compare: impl FnMut(&igraph_matrix_t, &igraph_matrix_t) -> Ordering, )

Sorts the items with a comparator, like slice::sort_by (stable; the items are moved, never copied).

Source

pub fn sort_by_key<K: Ord>(&mut self, key: impl FnMut(&igraph_matrix_t) -> K)

Sorts the items by a key, like slice::sort_by_key.

Source

pub fn capacity(&self) -> usize

Number of items the list can hold without reallocating (igraph_*_list_capacity).

Source

pub fn reserve(&mut self, capacity: usize)

Reserves storage for at least capacity items in total (igraph_*_list_reserve).

Source

pub fn push_copy(&mut self, item: &igraph_matrix_t)

Appends a deep copy of item (igraph_*_list_push_back_copy).

Source

pub fn get_mut(&mut self, index: usize) -> Option<&mut igraph_matrix_t>

The item at index, mutably, if any.

Source

pub fn first(&self) -> Option<&igraph_matrix_t>

The first item, if any.

Source

pub fn last(&self) -> Option<&igraph_matrix_t>

The last item, if any.

Source

pub fn iter_mut(&mut self) -> IterMut<'_, igraph_matrix_t>

Iterates over the items mutably.

Trait Implementations§

Source§

impl Clone for igraph_matrix_list_t

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for igraph_matrix_list_t

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for igraph_matrix_list_t

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for igraph_matrix_list_t

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Extend<igraph_matrix_t> for igraph_matrix_list_t

Source§

fn extend<I: IntoIterator<Item = igraph_matrix_t>>(&mut self, iter: I)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl From<Vec<igraph_matrix_t>> for igraph_matrix_list_t

Source§

fn from(items: Vec<igraph_matrix_t>) -> Self

Converts to this type from the input type.
Source§

impl FromIterator<igraph_matrix_t> for igraph_matrix_list_t

Source§

fn from_iter<I: IntoIterator<Item = igraph_matrix_t>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl Index<usize> for igraph_matrix_list_t

Source§

type Output = igraph_matrix_t

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &igraph_matrix_t

Performs the indexing (container[index]) operation. Read more
Source§

impl IndexMut<usize> for igraph_matrix_list_t

Source§

fn index_mut(&mut self, index: usize) -> &mut igraph_matrix_t

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<'a> IntoIterator for &'a igraph_matrix_list_t

Source§

type Item = &'a igraph_matrix_t

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, igraph_matrix_t>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl IntoIterator for igraph_matrix_list_t

Source§

type Item = igraph_matrix_t

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<igraph_matrix_t>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a> IntoIterator for &'a mut igraph_matrix_list_t

Source§

type Item = &'a mut igraph_matrix_t

The type of the elements being iterated over.
Source§

type IntoIter = IterMut<'a, igraph_matrix_t>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl Send for igraph_matrix_list_t

Source§

impl Sync for igraph_matrix_list_t

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.