pub trait SpatialContainer: ApproximateSpace + Sized {
type SpatialIter<'a>: Iterator<Item = (View<'a, Self::PointProxy>, View<'a, Self::ValueProxy>)>
where Self: 'a;
// Required methods
fn with_metric(metric: Self::Metric) -> Self;
fn insert(
&mut self,
point: Owned<Self::PointProxy>,
value: Owned<Self::ValueProxy>,
);
fn iter(&self) -> Self::SpatialIter<'_>;
// Provided methods
fn extend(
&mut self,
iter: impl IntoIterator<Item = (Owned<Self::PointProxy>, Owned<Self::ValueProxy>)>,
) { ... }
fn from_metric_and_iterator(
metric: Self::Metric,
batch: impl IntoIterator<Item = (Owned<Self::PointProxy>, Owned<Self::ValueProxy>)>,
) -> Self { ... }
}Expand description
Implement this trait on spatial containers that map points to values.
Required Associated Types§
type SpatialIter<'a>: Iterator<Item = (View<'a, Self::PointProxy>, View<'a, Self::ValueProxy>)> where Self: 'a
Required Methods§
Sourcefn with_metric(metric: Self::Metric) -> Self
fn with_metric(metric: Self::Metric) -> Self
Create a new instance of the data structure with the given metric.
Sourcefn insert(
&mut self,
point: Owned<Self::PointProxy>,
value: Owned<Self::ValueProxy>,
)
fn insert( &mut self, point: Owned<Self::PointProxy>, value: Owned<Self::ValueProxy>, )
Insert a (point, value) pair into a spatial data structure.
Sourcefn iter(&self) -> Self::SpatialIter<'_>
fn iter(&self) -> Self::SpatialIter<'_>
Iterate over all the point, value pairs in the data structure.
Provided Methods§
Sourcefn extend(
&mut self,
iter: impl IntoIterator<Item = (Owned<Self::PointProxy>, Owned<Self::ValueProxy>)>,
)
fn extend( &mut self, iter: impl IntoIterator<Item = (Owned<Self::PointProxy>, Owned<Self::ValueProxy>)>, )
Extend the data structure with additional data from an iterator of (point, value) pairs.
Sourcefn from_metric_and_iterator(
metric: Self::Metric,
batch: impl IntoIterator<Item = (Owned<Self::PointProxy>, Owned<Self::ValueProxy>)>,
) -> Self
fn from_metric_and_iterator( metric: Self::Metric, batch: impl IntoIterator<Item = (Owned<Self::PointProxy>, Owned<Self::ValueProxy>)>, ) -> Self
Create a new instance of the data structure with the given metric and an iterator of (point, value) pairs.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".