FeatureMapView

Struct FeatureMapView 

Source
pub struct FeatureMapView<'a, X, Y, T>
where T: FeatureLike<X, Y>,
{ /* private fields */ }

Implementations§

Source§

impl<'a, X, Y, T> FeatureMapView<'a, X, Y, T>
where T: FeatureLike<X, Y>,

Source

pub fn new(features: &'a [T]) -> FeatureMapView<'a, X, Y, T>

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

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

Trait Implementations§

Source§

impl<'a, X, Y, T> Clone for FeatureMapView<'a, X, Y, T>
where X: Clone, Y: Clone, T: Clone + FeatureLike<X, Y>,

Source§

fn clone(&self) -> FeatureMapView<'a, X, Y, T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a, X, Y, T> Debug for FeatureMapView<'a, X, Y, T>
where X: Debug, Y: Debug, T: Debug + FeatureLike<X, Y>,

Source§

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

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

impl<'a, X, Y, T> Default for FeatureMapView<'a, X, Y, T>
where X: Default, Y: Default, T: Default + FeatureLike<X, Y>,

Source§

fn default() -> FeatureMapView<'a, X, Y, T>

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

impl<X, Y, T> FeatureMapLike<X, Y, T> for FeatureMapView<'_, X, Y, T>
where T: FeatureLike<X, Y>,

Source§

fn search_by(&self, query: f64) -> Result<usize, usize>

Source§

fn len(&self) -> usize

Source§

fn is_empty(&self) -> bool

Source§

fn get_item(&self, i: usize) -> &T

Implement index access
Source§

fn get_slice(&self, i: Range<usize>) -> &[T]

Source§

fn iter<'b>(&'b self) -> impl Iterator<Item = &'b T>
where T: 'b,

Source§

unsafe fn get_item_unchecked(&self, i: usize) -> &T

Implement index access without bounds checking. Read more
Source§

fn _closest_feature( &self, query: f64, error_tolerance: Tolerance, i: usize, ) -> Option<usize>

Source§

fn search(&self, query: f64, error_tolerance: Tolerance) -> Option<usize>

Find the nearest index for query within error_tolerance in this feature collection, or None.
Source§

fn has_feature(&self, query: f64, error_tolerance: Tolerance) -> Option<&T>

Return the feature nearest to query within error_tolerance in this feature collection, or None.
Source§

fn indices_between( &self, low: f64, high: f64, error_tolerance: Tolerance, ) -> Range<usize>

Return the index range containing all features between low and high coordinates within error_tolerance. Read more
Source§

fn between(&self, low: f64, high: f64, error_tolerance: Tolerance) -> &[T]

Return a slice containing all features between low and high coordinates within error_tolerance.
Source§

fn all_indices_for( &self, query: f64, error_tolerance: Tolerance, ) -> Range<usize>

Find all feature indices which could match query within error_tolerance units. Read more
Source§

fn all_features_for(&self, query: f64, error_tolerance: Tolerance) -> &[T]

Find all features which could match query within error_tolerance units
Source§

impl<'a, X, Y, T> Index<Range<usize>> for FeatureMapView<'a, X, Y, T>
where T: FeatureLike<X, Y>,

Source§

type Output = [<FeatureMapView<'a, X, Y, T> as Index<usize>>::Output]

The returned type after indexing.
Source§

fn index( &self, index: Range<usize>, ) -> &<FeatureMapView<'a, X, Y, T> as Index<Range<usize>>>::Output

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

impl<'a, X, Y, T> Index<RangeFrom<usize>> for FeatureMapView<'a, X, Y, T>
where T: FeatureLike<X, Y>,

Source§

type Output = [<FeatureMapView<'a, X, Y, T> as Index<usize>>::Output]

The returned type after indexing.
Source§

fn index( &self, index: RangeFrom<usize>, ) -> &<FeatureMapView<'a, X, Y, T> as Index<RangeFrom<usize>>>::Output

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

impl<'a, X, Y, T> Index<RangeFull> for FeatureMapView<'a, X, Y, T>
where T: FeatureLike<X, Y>,

Source§

type Output = [<FeatureMapView<'a, X, Y, T> as Index<usize>>::Output]

The returned type after indexing.
Source§

fn index( &self, _: RangeFull, ) -> &<FeatureMapView<'a, X, Y, T> as Index<RangeFull>>::Output

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

impl<'a, X, Y, T> Index<RangeTo<usize>> for FeatureMapView<'a, X, Y, T>
where T: FeatureLike<X, Y>,

Source§

type Output = [<FeatureMapView<'a, X, Y, T> as Index<usize>>::Output]

The returned type after indexing.
Source§

fn index( &self, index: RangeTo<usize>, ) -> &<FeatureMapView<'a, X, Y, T> as Index<RangeTo<usize>>>::Output

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

impl<X, Y, T> Index<usize> for FeatureMapView<'_, X, Y, T>
where T: FeatureLike<X, Y>,

Source§

type Output = T

The returned type after indexing.
Source§

fn index( &self, i: usize, ) -> &<FeatureMapView<'_, X, Y, T> as Index<usize>>::Output

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

impl<'a, X, Y, T> IntoIterator for FeatureMapView<'a, X, Y, T>
where T: FeatureLike<X, Y>,

Source§

type Item = &'a T

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, T>

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

fn into_iter(self) -> <FeatureMapView<'a, X, Y, T> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<'a, X, Y, T> Freeze for FeatureMapView<'a, X, Y, T>

§

impl<'a, X, Y, T> RefUnwindSafe for FeatureMapView<'a, X, Y, T>

§

impl<'a, X, Y, T> Send for FeatureMapView<'a, X, Y, T>
where X: Send, Y: Send, T: Sync,

§

impl<'a, X, Y, T> Sync for FeatureMapView<'a, X, Y, T>
where X: Sync, Y: Sync, T: Sync,

§

impl<'a, X, Y, T> Unpin for FeatureMapView<'a, X, Y, T>
where X: Unpin, Y: Unpin,

§

impl<'a, X, Y, T> UnwindSafe for FeatureMapView<'a, X, Y, T>

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.