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>

source

pub fn new() -> Self

source

pub fn with_length(length: usize) -> Self

source

pub fn capacity(&self) -> usize

capacity of the array, not necessarily the number of contained element

source

pub fn clear(&mut self)

source

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

source

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

source

pub fn as_ptr(&self) -> *const H3Index

source

pub fn as_mut_ptr(&mut self) -> *mut H3Index

source

pub fn iter(&self) -> UncheckedIter<'_, T>

source

pub fn iter_checked(&self) -> CheckedIter<'_, T>

source

pub fn iter_unchecked(&self) -> UncheckedIter<'_, T>

source

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

source

pub fn is_empty(&self) -> bool

source

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

source

pub fn shrink_to_fit(&mut self)

source

pub fn drain(&mut self) -> UncheckedDrain<'_, T>

source

pub fn append(&mut self, other: &mut Self)

source

pub fn dedup(&mut self)

source

pub fn sort_unstable(&mut self)

source

pub fn count(&self) -> usize

source

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

Trait Implementations§

source§

impl<T: Debug + FromH3Index + Index> Debug for IndexVec<T>

source§

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

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

impl<T: FromH3Index + Index> Default for IndexVec<T>

source§

fn default() -> Self

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

impl<T> From<IndexVec<T>> for IndexBlock<T>
where T: Index + Copy,

source§

fn from(ivc: IndexVec<T>) -> Self

Converts to this type from the input type.
source§

impl<T: FromH3Index + Index> From<IndexVec<T>> for Vec<T>

source§

fn from(index_vec: IndexVec<T>) -> Self

Converts to this type from the input type.
source§

impl<'a, T: FromH3Index + Index> IntoIterator for &'a IndexVec<T>

§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = UncheckedIter<'a, 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 ToLinkedPolygons for IndexVec<H3Cell>

§

type Error = Error

source§

fn to_linked_polygons( &self, smoothen: bool ) -> Result<Vec<Polygon<f64>>, Self::Error>

source§

impl<T: FromH3Index + Index> TryFrom<Vec<u64>> for IndexVec<T>

§

type Error = Error

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

fn try_from(h3index_vec: Vec<H3Index>) -> Result<Self, Self::Error>

Performs the conversion.

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> 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> 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

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

§

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>,

§

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.
source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

source§

fn is_within(&self, b: &G2) -> bool