Expand description
Object-safe Dataset + Layer traits — the polymorphic surface that
every concrete reader (geonative-filegdb, geonative-shapefile, future
GPKG / GeoJSON / FlatGeoBuf) implements.
§When to use traits vs concrete types
- Concrete types (
geonative_filegdb::Geodatabase,geonative_shapefile::Shapefile, …) are zero-cost — no virtual dispatch, no boxing. Use them when your code knows the format up front. - Traits (
Dataset,Layer) enable format-polymorphic code: a converter that opens any source and writes to any sink, a CLI that probes by extension, etc. The cost isBox<dyn>(one indirection per call).
§Single-layer formats
Shapefile-style formats have no concept of multiple layers per file. The
SingleLayerDataset adapter wraps any Layer so it can stand in for
a Dataset (with a single sentinel layer name, default "default").
Structs§
- Single
Layer Dataset - Adapter that wraps any
Layerin aDatasetfacade with one sentinel layer name. Use this when a single-layer format like Shapefile needs to satisfy aDatasetinterface.