pub struct ObjectRef<'a, T: RTreeObject> { /* private fields */ }
Expand description
An RTreeObject that is a possibly short-lived reference to another object.
Sometimes it can be useful to build an [RTree] that does not own its constituent objects but references them from elsewhere. Wrapping the bare references with this combinator makes this possible.
Note: the wrapper implements RTreeObject and referenced object T
can be
accessed via an implementation of Deref<Target=T>
.
Implementations§
Trait Implementations§
Source§impl<'a, T: RTreeObject> Deref for ObjectRef<'a, T>
impl<'a, T: RTreeObject> Deref for ObjectRef<'a, T>
Source§impl<'a, T: Ord + RTreeObject> Ord for ObjectRef<'a, T>
impl<'a, T: Ord + RTreeObject> Ord for ObjectRef<'a, T>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a, T: PartialOrd + RTreeObject> PartialOrd for ObjectRef<'a, T>
impl<'a, T: PartialOrd + RTreeObject> PartialOrd for ObjectRef<'a, T>
Source§impl<'a, T: PointDistance> PointDistance for ObjectRef<'a, T>
impl<'a, T: PointDistance> PointDistance for ObjectRef<'a, T>
Source§fn distance_2(
&self,
point: &<Self::Envelope as Envelope>::Point,
) -> <<Self::Envelope as Envelope>::Point as Point>::Scalar
fn distance_2( &self, point: &<Self::Envelope as Envelope>::Point, ) -> <<Self::Envelope as Envelope>::Point as Point>::Scalar
Returns the squared distance between an object and a point. Read more
Source§fn contains_point(&self, p: &<Self::Envelope as Envelope>::Point) -> bool
fn contains_point(&self, p: &<Self::Envelope as Envelope>::Point) -> bool
Returns
true
if a point is contained within this object. Read moreSource§fn distance_2_if_less_or_equal(
&self,
point: &<Self::Envelope as Envelope>::Point,
max_distance_2: <<Self::Envelope as Envelope>::Point as Point>::Scalar,
) -> Option<<<Self::Envelope as Envelope>::Point as Point>::Scalar>
fn distance_2_if_less_or_equal( &self, point: &<Self::Envelope as Envelope>::Point, max_distance_2: <<Self::Envelope as Envelope>::Point as Point>::Scalar, ) -> Option<<<Self::Envelope as Envelope>::Point as Point>::Scalar>
Returns the squared distance to this object, or
None
if the distance
is larger than a given maximum value. Read moreSource§impl<'a, T: RTreeObject> RTreeObject for ObjectRef<'a, T>
impl<'a, T: RTreeObject> RTreeObject for ObjectRef<'a, T>
impl<'a, T: Copy + RTreeObject> Copy for ObjectRef<'a, T>
impl<'a, T: Eq + RTreeObject> Eq for ObjectRef<'a, T>
impl<'a, T: RTreeObject> StructuralPartialEq for ObjectRef<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for ObjectRef<'a, T>
impl<'a, T> RefUnwindSafe for ObjectRef<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for ObjectRef<'a, T>where
T: Sync,
impl<'a, T> Sync for ObjectRef<'a, T>where
T: Sync,
impl<'a, T> Unpin for ObjectRef<'a, T>
impl<'a, T> UnwindSafe for ObjectRef<'a, T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more