Struct spatial::tree::mbr::MbrMap

source ·
pub struct MbrMap<NODE, I, R> { /* private fields */ }
Expand description

The generic container interface for spatial maps. Will, at the very least, be able to support R, R+, R*, and X trees

Implementations§

source§

impl<P: FP, const DIM: usize, LG, I, R, T> MbrMap<RTreeNode<P, DIM, LG, T>, I, R>
where LG: MbrLeafGeometry<P, DIM>, I: IndexInsert<P, DIM, LG, T, RTreeNode<P, DIM, LG, T>>, R: IndexRemove<P, DIM, LG, T, RTreeNode<P, DIM, LG, T>, I>,

source

pub fn new( insert_index: I, remove_index: R ) -> MbrMap<RTreeNode<P, DIM, LG, T>, I, R>

Create a new MbrMap with the given insert and remove indexes

source

pub fn insert(&mut self, geometry: LG, item: T)

Insert an item

source

pub fn remove<Q: MbrQuery<P, DIM, LG, T, RTreeNode<P, DIM, LG, T>>>( &mut self, query: Q ) -> Vec<(LG, T)>

Remove all items whose shapes are accepted by the query. Returns removed entries.

source

pub fn retain<Q: MbrQuery<P, DIM, LG, T, RTreeNode<P, DIM, LG, T>>, F: FnMut(&T) -> bool>( &mut self, query: Q, f: F ) -> Vec<(LG, T)>

Remove all items whose shapes are accepted by the query and where f(&T) returns false. Returns removed entries

source

pub fn is_empty(&self) -> bool

Whether the map is empty

source

pub fn len(&self) -> usize

Length of the map

source

pub fn clear(&mut self)

Clear the map

source

pub fn iter(&self) -> Iter<'_, P, DIM, LG, T, MbrRectQuery<P, DIM>>

Iter for the map

source

pub fn iter_mut(&mut self) -> IterMut<'_, P, DIM, LG, T, MbrRectQuery<P, DIM>>

IterMut for the map

source

pub fn iter_query<Q: MbrQuery<P, DIM, LG, T, RTreeNode<P, DIM, LG, T>>>( &self, query: Q ) -> Iter<'_, P, DIM, LG, T, Q>

Iter for the map with a given query

source

pub fn iter_query_mut<Q: MbrQuery<P, DIM, LG, T, RTreeNode<P, DIM, LG, T>>>( &mut self, query: Q ) -> IterMut<'_, P, DIM, LG, T, Q>

IterMut for the map with a given query

Auto Trait Implementations§

§

impl<NODE, I, R> Freeze for MbrMap<NODE, I, R>
where I: Freeze, R: Freeze, NODE: Freeze,

§

impl<NODE, I, R> RefUnwindSafe for MbrMap<NODE, I, R>

§

impl<NODE, I, R> Send for MbrMap<NODE, I, R>
where I: Send, R: Send, NODE: Send,

§

impl<NODE, I, R> Sync for MbrMap<NODE, I, R>
where I: Sync, R: Sync, NODE: Sync,

§

impl<NODE, I, R> Unpin for MbrMap<NODE, I, R>
where I: Unpin, R: Unpin, NODE: Unpin,

§

impl<NODE, I, R> UnwindSafe for MbrMap<NODE, I, R>
where I: UnwindSafe, R: UnwindSafe, NODE: 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.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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.