Struct h3ron::collections::indexvec::IndexVec
source · pub struct IndexVec<T: FromH3Index + Index> { /* private fields */ }
Expand description
A H3Index
-Vec intended to interface between libh3 by providing
continuous memory to place h3indexes in.
Provides iterators to create Index
implementing types from the primitive H3Index
/u64
types. The iterators automatically skip all 0
values (as created some libh3 functions).
The struct does not provide a len()
method as this would create the impression that accessing
this method is cheap. As a count of the contained elements requires checking each for 0
, that
functionality is provided by IndexVec::count()
Implementations§
source§impl<T: FromH3Index + Index> IndexVec<T>
impl<T: FromH3Index + Index> IndexVec<T>
pub fn new() -> Self
pub fn with_length(length: usize) -> Self
sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
capacity of the array, not necessarily the number of contained element
pub fn clear(&mut self)
pub fn as_slice(&self) -> &[H3Index]
pub fn as_mut_slice(&mut self) -> &mut [H3Index]
pub fn as_ptr(&self) -> *const H3Index
pub fn as_mut_ptr(&mut self) -> *mut H3Index
pub fn iter(&self) -> UncheckedIter<'_, T> ⓘ
pub fn iter_checked(&self) -> CheckedIter<'_, T> ⓘ
pub fn iter_unchecked(&self) -> UncheckedIter<'_, T> ⓘ
pub fn first(&self) -> Option<T>
pub fn is_empty(&self) -> bool
pub fn pop(&mut self) -> Option<T>
pub fn shrink_to_fit(&mut self)
pub fn drain(&mut self) -> UncheckedDrain<'_, T> ⓘ
pub fn append(&mut self, other: &mut Self)
pub fn dedup(&mut self)
pub fn sort_unstable(&mut self)
pub fn count(&self) -> usize
pub fn push(&mut self, item: T)
Trait Implementations§
source§impl<T> From<IndexVec<T>> for IndexBlock<T>
impl<T> From<IndexVec<T>> for IndexBlock<T>
source§impl<'a, T: FromH3Index + Index> IntoIterator for &'a IndexVec<T>
impl<'a, T: FromH3Index + Index> IntoIterator for &'a IndexVec<T>
source§impl ToLinkedPolygons for IndexVec<H3Cell>
impl ToLinkedPolygons for IndexVec<H3Cell>
Auto Trait Implementations§
impl<T> RefUnwindSafe for IndexVec<T>where
T: RefUnwindSafe,
impl<T> Send for IndexVec<T>where
T: Send,
impl<T> Sync for IndexVec<T>where
T: Sync,
impl<T> Unpin for IndexVec<T>where
T: Unpin,
impl<T> UnwindSafe for IndexVec<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more