Struct Node

Source
pub struct Node<'a, N: IndexableNum, T: KDTreeIndex<N>> { /* private fields */ }
Expand description

An internal node in the KDTree.

Implementations§

Source§

impl<'a, N: IndexableNum, T: KDTreeIndex<N>> Node<'a, N, T>

Source

pub fn left_child(&self) -> Option<Node<'_, N, T>>

The child node representing the “left” half.

Returns None if Self::is_parent is false.

Source

pub fn left_child_unchecked(&self) -> Node<'_, N, T>

The child node representing the “left” half.

Note that this does not include the middle index of the current node.

Source

pub fn right_child(&self) -> Option<Node<'_, N, T>>

The child node representing the “right” half.

Returns None if Self::is_parent is false.

Source

pub fn right_child_unchecked(&self) -> Node<'_, N, T>

The child node representing the “right” half.

Note that this does not include the middle index of the current node.

Source

pub fn is_leaf(&self) -> bool

Returns true if this is a leaf node without children.

Source

pub fn is_parent(&self) -> bool

Returns true if this is an intermediate node with children.

Source

pub fn middle_insertion_index(&self) -> Option<u32>

The original insertion index of the “middle child” of this node. This is only valid when this is a parent node, which you can check with Self::is_parent.

Returns None if Self::is_parent is false.

Source

pub fn middle_insertion_index_unchecked(&self) -> u32

The original insertion index of the “middle child” of this node. This is only valid when this is a parent node, which you can check with Self::is_parent.

Source

pub fn leaf_insertion_indices(&self) -> Option<Vec<u32>>

The original insertion indices. This is only valid when this is a leaf node, which you can check with Self::is_leaf.

Returns None if Self::is_leaf is false.

Source

pub fn leaf_insertion_indices_unchecked(&self) -> Vec<u32>

The original insertion indices. This is only valid when this is a leaf node, which you can check with Self::is_leaf.

Trait Implementations§

Source§

impl<'a, N: Clone + IndexableNum, T: Clone + KDTreeIndex<N>> Clone for Node<'a, N, T>

Source§

fn clone(&self) -> Node<'a, N, 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, N: Debug + IndexableNum, T: Debug + KDTreeIndex<N>> Debug for Node<'a, N, T>

Source§

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

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

impl<N: IndexableNum, T: KDTreeIndex<N>> GeometryTrait for Node<'_, N, T>

Source§

type T = N

The coordinate type of this geometry
Source§

type PointType<'a> = UnimplementedPoint<N> where Self: 'a

The type of each underlying Point, which implements PointTrait
Source§

type LineStringType<'a> = UnimplementedLineString<N> where Self: 'a

The type of each underlying LineString, which implements LineStringTrait
Source§

type PolygonType<'a> = UnimplementedPolygon<N> where Self: 'a

The type of each underlying Polygon, which implements PolygonTrait
Source§

type MultiPointType<'a> = UnimplementedMultiPoint<N> where Self: 'a

The type of each underlying MultiPoint, which implements MultiPointTrait
Source§

type MultiLineStringType<'a> = UnimplementedMultiLineString<N> where Self: 'a

The type of each underlying MultiLineString, which implements MultiLineStringTrait
Source§

type MultiPolygonType<'a> = UnimplementedMultiPolygon<N> where Self: 'a

The type of each underlying MultiPolygon, which implements MultiPolygonTrait
Source§

type GeometryCollectionType<'a> = UnimplementedGeometryCollection<N> where Self: 'a

The type of each underlying GeometryCollection, which implements GeometryCollectionTrait
Source§

type RectType<'a> = Node<'a, N, T> where Self: 'a

The type of each underlying Rect, which implements RectTrait
Source§

type TriangleType<'a> = UnimplementedTriangle<N> where Self: 'a

The type of each underlying Triangle, which implements TriangleTrait
Source§

type LineType<'a> = UnimplementedLine<N> where Self: 'a

The type of each underlying Line, which implements LineTrait
Source§

fn dim(&self) -> Dimensions

The dimension of this geometry
Source§

fn as_type( &self, ) -> GeometryType<'_, Self::PointType<'_>, Self::LineStringType<'_>, Self::PolygonType<'_>, Self::MultiPointType<'_>, Self::MultiLineStringType<'_>, Self::MultiPolygonType<'_>, Self::GeometryCollectionType<'_>, Self::RectType<'_>, Self::TriangleType<'_>, Self::LineType<'_>>

Cast this geometry to a GeometryType enum, which allows for downcasting to a specific type
Source§

impl<N: IndexableNum, T: KDTreeIndex<N>> RectTrait for Node<'_, N, T>

Source§

type CoordType<'a> = Coord<N> where Self: 'a

The type of each underlying coordinate, which implements CoordTrait
Source§

fn min(&self) -> Self::CoordType<'_>

The minimum coordinate of this Rect
Source§

fn max(&self) -> Self::CoordType<'_>

The maximum coordinate of this Rect

Auto Trait Implementations§

§

impl<'a, N, T> Freeze for Node<'a, N, T>
where N: Freeze,

§

impl<'a, N, T> RefUnwindSafe for Node<'a, N, T>

§

impl<'a, N, T> Send for Node<'a, N, T>
where T: Sync,

§

impl<'a, N, T> Sync for Node<'a, N, T>
where T: Sync,

§

impl<'a, N, T> Unpin for Node<'a, N, T>
where N: Unpin,

§

impl<'a, N, T> UnwindSafe for Node<'a, N, 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, G> ToGeoGeometry<T> for G
where T: CoordNum, G: GeometryTrait<T = T>,

Source§

fn try_to_geometry(&self) -> Option<Geometry<T>>

Convert to a geo_types Geometry. Read more
Source§

fn to_geometry(&self) -> Geometry<T>

Convert to a geo_types Geometry. Read more
Source§

impl<T, G> ToGeoRect<T> for G
where T: CoordNum, G: RectTrait<T = T>,

Source§

fn to_rect(&self) -> Rect<T>

Convert to a geo_types Rect.
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.