pub struct igraph_bitset_list_t { /* private fields */ }Implementations§
Source§impl igraph_bitset_list_t
impl igraph_bitset_list_t
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates an empty list
(igraph_*_list_init).
Sourcepub fn as_slice(&self) -> &[igraph_bitset_t]
pub fn as_slice(&self) -> &[igraph_bitset_t]
The items as a slice of the C item type.
Sourcepub fn as_mut_slice(&mut self) -> &mut [igraph_bitset_t]
pub fn as_mut_slice(&mut self) -> &mut [igraph_bitset_t]
The items as a mutable slice of the C item type.
Sourcepub fn get(&self, index: usize) -> Option<&igraph_bitset_t>
pub fn get(&self, index: usize) -> Option<&igraph_bitset_t>
The item at index, if any.
Sourcepub fn iter(&self) -> Iter<'_, igraph_bitset_t>
pub fn iter(&self) -> Iter<'_, igraph_bitset_t>
Iterates over the items by reference.
Sourcepub fn push(&mut self, item: igraph_bitset_t)
pub fn push(&mut self, item: igraph_bitset_t)
Appends an item, transferring its ownership to the list
(igraph_*_list_push_back).
Sourcepub fn pop(&mut self) -> Option<igraph_bitset_t>
pub fn pop(&mut self) -> Option<igraph_bitset_t>
Removes and returns the last item, if any; the caller owns it
(igraph_*_list_pop_back).
Sourcepub fn remove(&mut self, index: usize) -> igraph_bitset_t
pub fn remove(&mut self, index: usize) -> igraph_bitset_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.
Sourcepub fn into_vec(self) -> Vec<igraph_bitset_t>
pub fn into_vec(self) -> Vec<igraph_bitset_t>
Converts into a Vec of owned items, without copying them.
Source§impl igraph_bitset_list_t
impl igraph_bitset_list_t
Sourcepub fn insert(&mut self, pos: usize, item: igraph_bitset_t)
pub fn insert(&mut self, pos: usize, item: igraph_bitset_t)
Inserts item at position pos, shifting the following items;
the list takes ownership of it
(igraph_*_list_insert).
§Panics
If pos > len.
Sourcepub fn replace(&mut self, pos: usize, item: igraph_bitset_t) -> igraph_bitset_t
pub fn replace(&mut self, pos: usize, item: igraph_bitset_t) -> igraph_bitset_t
Replaces the item at pos with item, returning the old one
(igraph_*_list_replace).
§Panics
If pos >= len.
Sourcepub fn swap_remove(&mut self, pos: usize) -> igraph_bitset_t
pub fn swap_remove(&mut self, pos: usize) -> igraph_bitset_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.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Destroys all the items, keeping the storage
(igraph_*_list_clear).
Sourcepub fn reverse(&mut self)
pub fn reverse(&mut self)
Reverses the order of the items
(igraph_*_list_reverse, undocumented in igraph_vector_list.h).
Sourcepub fn swap(&mut self, i: usize, j: usize)
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.
Sourcepub fn permute(&mut self, index: &[igraph_int_t]) -> Result<()>
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).
Sourcepub fn sort_by(
&mut self,
compare: impl FnMut(&igraph_bitset_t, &igraph_bitset_t) -> Ordering,
)
pub fn sort_by( &mut self, compare: impl FnMut(&igraph_bitset_t, &igraph_bitset_t) -> Ordering, )
Sorts the items with a comparator, like slice::sort_by
(stable; the items are moved, never copied).
Sourcepub fn sort_by_key<K: Ord>(&mut self, key: impl FnMut(&igraph_bitset_t) -> K)
pub fn sort_by_key<K: Ord>(&mut self, key: impl FnMut(&igraph_bitset_t) -> K)
Sorts the items by a key, like slice::sort_by_key.
Sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Number of items the list can hold without reallocating
(igraph_*_list_capacity).
Sourcepub fn reserve(&mut self, capacity: usize)
pub fn reserve(&mut self, capacity: usize)
Reserves storage for at least capacity items in total
(igraph_*_list_reserve).
Sourcepub fn push_copy(&mut self, item: &igraph_bitset_t)
pub fn push_copy(&mut self, item: &igraph_bitset_t)
Appends a deep copy of item
(igraph_*_list_push_back_copy).
Sourcepub fn get_mut(&mut self, index: usize) -> Option<&mut igraph_bitset_t>
pub fn get_mut(&mut self, index: usize) -> Option<&mut igraph_bitset_t>
The item at index, mutably, if any.
Sourcepub fn first(&self) -> Option<&igraph_bitset_t>
pub fn first(&self) -> Option<&igraph_bitset_t>
The first item, if any.
Sourcepub fn last(&self) -> Option<&igraph_bitset_t>
pub fn last(&self) -> Option<&igraph_bitset_t>
The last item, if any.
Sourcepub fn iter_mut(&mut self) -> IterMut<'_, igraph_bitset_t>
pub fn iter_mut(&mut self) -> IterMut<'_, igraph_bitset_t>
Iterates over the items mutably.
Trait Implementations§
Source§impl Clone for igraph_bitset_list_t
impl Clone for igraph_bitset_list_t
Source§impl Debug for igraph_bitset_list_t
impl Debug for igraph_bitset_list_t
Source§impl Default for igraph_bitset_list_t
impl Default for igraph_bitset_list_t
Source§impl Drop for igraph_bitset_list_t
impl Drop for igraph_bitset_list_t
Source§impl Extend<igraph_bitset_t> for igraph_bitset_list_t
impl Extend<igraph_bitset_t> for igraph_bitset_list_t
Source§fn extend<I: IntoIterator<Item = igraph_bitset_t>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = igraph_bitset_t>>(&mut self, iter: I)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)