Skip to main content

Layer

Trait Layer 

Source
pub trait Layer {
    // Required methods
    fn name(&self) -> &str;
    fn schema(&self) -> &Schema;
    fn feature_count(&self) -> Option<i64>;
    fn read<'a>(&'a self) -> Box<dyn Iterator<Item = Result<Feature>> + 'a>;
}
Expand description

A stream of features sharing one schema — the polymorphic equivalent of geonative_filegdb::Layer, geonative_shapefile::Shapefile, etc.

Required Methods§

Source

fn name(&self) -> &str

Human-friendly layer name (single-layer formats: "default").

Source

fn schema(&self) -> &Schema

The schema of this layer’s features.

Source

fn feature_count(&self) -> Option<i64>

Declared feature count, if the format exposes it cheaply. Returns None if computing the count would require a full scan.

Source

fn read<'a>(&'a self) -> Box<dyn Iterator<Item = Result<Feature>> + 'a>

Lazy feature iterator. Each call starts a fresh pass over the layer.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§