Struct planetkit::globe::Cursor [] [src]

pub struct Cursor<'a> { /* fields omitted */ }

A cell-oriented view into a globe.

Behaves similarly to an iterator, in that it borrows the globe being viewed, but unlike an iterator it offers multiple methods for navigating between elements.

Cursor exists to help with algorithms that perform a lot of local navigation between cells, by avoiding the high cost of random access.

Methods

impl<'a> Cursor<'a>
[src]

[src]

Creates a new cursor at the origin of the given chunk.

Use this if you know that a particular chunk is loaded, and you want to read cells from that chunk rather than any neighboring chunk that might share the same cells.

Note that the given chunk might not own the cells you're asking for; they might belong to a different root quad.

[src]

[src]

[src]

[src]

Get a reference to the cell the cursor is currently pointing at.

Note that this cell might come from a chunk that doesn't own it, unless you've deliberately ensured you pointed at the cell in its owning root.

Returns None if the requested cell is in a chunk that isn't loaded.

Trait Implementations

impl<'a> Clone for Cursor<'a>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more