pub struct FeatureStore { /* private fields */ }Expand description
Persistent bbox store backed by redb.
For incremental tile updates, we only need to know WHICH tiles are affected by a change. We store the bounding box of each feature by OSM ID. The full feature data (geometry, tags) lives in the PMTiles output and is regenerated from the PBF + changes.
Implementations§
Source§impl FeatureStore
impl FeatureStore
Sourcepub fn open(path: &Path) -> OsmicResult<Self>
pub fn open(path: &Path) -> OsmicResult<Self>
Open or create a feature store at the given path.
Sourcepub fn upsert(&self, id: i64, bbox: &BBox) -> OsmicResult<Option<BBox>>
pub fn upsert(&self, id: i64, bbox: &BBox) -> OsmicResult<Option<BBox>>
Store a feature’s bounding box. Returns the old bbox if it existed.
Sourcepub fn delete(&self, id: i64) -> OsmicResult<Option<BBox>>
pub fn delete(&self, id: i64) -> OsmicResult<Option<BBox>>
Delete a feature’s bbox by ID. Returns the old bbox if it existed.
Sourcepub fn len(&self) -> OsmicResult<u64>
pub fn len(&self) -> OsmicResult<u64>
Count of features in the store.
pub fn is_empty(&self) -> OsmicResult<bool>
Auto Trait Implementations§
impl !RefUnwindSafe for FeatureStore
impl !UnwindSafe for FeatureStore
impl Freeze for FeatureStore
impl Send for FeatureStore
impl Sync for FeatureStore
impl Unpin for FeatureStore
impl UnsafeUnpin for FeatureStore
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Creates a shared type from an unshared type.