pub struct ChartStore { /* private fields */ }Expand description
A chart, open for reading.
Opened read-only and kept that way. This crate performs no writes; routes and tracks are stored in a separate writable database.
Implementations§
Source§impl ChartStore
impl ChartStore
Sourcepub fn open(path: &Path) -> Result<Self, StoreError>
pub fn open(path: &Path) -> Result<Self, StoreError>
Sourcepub fn path(&self) -> &Path
pub fn path(&self) -> &Path
The path this chart was opened from. ChartStore does not
expose its connection, so a caller deriving a related path (a
cache file, a log entry) has no other way to obtain it.
Sourcepub fn object_classes(&self) -> Vec<String>
pub fn object_classes(&self) -> Vec<String>
The object classes this chart carries, upper case and sorted.
Sourcepub fn features_in(
&self,
class: &str,
bounds: Rect<f64>,
) -> Result<Vec<Feature>, StoreError>
pub fn features_in( &self, class: &str, bounds: Rect<f64>, ) -> Result<Vec<Feature>, StoreError>
Every feature of one class whose bounding box meets bounds.
A bounding-box result, not an exact one: the R-Tree narrows candidates, and the caller performs the precise geometry test. The index stays plain SQL and the geometry test stays in Rust, so reading the chart file requires no SQLite extension.
§Errors
If the class is not in this chart, or a row cannot be read.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ChartStore
impl !RefUnwindSafe for ChartStore
impl !Sync for ChartStore
impl !UnwindSafe for ChartStore
impl Send for ChartStore
impl Unpin for ChartStore
impl UnsafeUnpin for ChartStore
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more