Struct SpatialQueryReport
pub struct SpatialQueryReport {
pub written: usize,
pub total: usize,
}Expand description
Counts from a successful caller-buffer query on SpatialGrid.
An exactly full buffer is complete when written == total; only omitted
matches count as truncation. A zero-length buffer still reports total.
use ferravex_engine::spatial::SpatialGrid;
let mut grid = SpatialGrid::new(1.0, 2)?;
grid.insert(7, [0.0, 0.0])?;
let report = grid.query_into([0.0, 0.0], [1.0, 1.0], &mut [])?;
assert_eq!((report.written, report.total), (0, 1));
assert!(report.is_truncated());Fields§
§written: usizeNumber of results written to the start of the caller’s buffer, in query order.
total: usizeTotal matching points, including those omitted from the buffer.
Implementations§
§impl SpatialQueryReport
impl SpatialQueryReport
pub const fn is_truncated(self) -> bool
pub const fn is_truncated(self) -> bool
Whether matches were omitted by storage capacity or a nearest-query k limit.
use ferravex_engine::spatial::SpatialQueryReport;
assert!(!SpatialQueryReport { written: 2, total: 2 }.is_truncated());
assert!(SpatialQueryReport { written: 2, total: 3 }.is_truncated());Trait Implementations§
§impl Clone for SpatialQueryReport
impl Clone for SpatialQueryReport
§fn clone(&self) -> SpatialQueryReport
fn clone(&self) -> SpatialQueryReport
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for SpatialQueryReport
impl Debug for SpatialQueryReport
§impl Default for SpatialQueryReport
impl Default for SpatialQueryReport
§fn default() -> SpatialQueryReport
fn default() -> SpatialQueryReport
Returns the “default value” for a type. Read more
§impl PartialEq for SpatialQueryReport
impl PartialEq for SpatialQueryReport
impl Copy for SpatialQueryReport
impl Eq for SpatialQueryReport
impl StructuralPartialEq for SpatialQueryReport
Auto Trait Implementations§
impl Freeze for SpatialQueryReport
impl RefUnwindSafe for SpatialQueryReport
impl Send for SpatialQueryReport
impl Sync for SpatialQueryReport
impl Unpin for SpatialQueryReport
impl UnwindSafe for SpatialQueryReport
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